1 #!/usr/bin/env python 2 3 # Copyright (c) 2012 Google Inc. All rights reserved. 4 # Use of this source code is governed by a BSD-style license that can be 5 # found in the LICENSE file. 6 7 """ 8 Make sure we generate a manifest file when linking binaries, including 9 handling AdditionalManifestFiles. 10 """ 11 12 import TestGyp 13 14 import sys 15 16 if sys.platform == 'win32': 17 test = TestGyp.TestGyp(formats=['msvs', 'ninja']) 18 19 CHDIR = 'linker-flags' 20 test.run_gyp('generate-manifest.gyp', chdir=CHDIR) 21 test.build('generate-manifest.gyp', test.ALL, chdir=CHDIR) 22 test.built_file_must_exist('test_manifest_exe.exe.manifest', chdir=CHDIR) 23 test.built_file_must_exist('test_manifest_dll.dll.manifest', chdir=CHDIR) 24 25 # Must contain the Win7 support GUID, but not the Vista one (from 26 # extra2.manifest). 27 extra1_manifest = test.built_file_path( 28 'test_manifest_extra1.exe.manifest', chdir=CHDIR) 29 test.must_contain(extra1_manifest, '35138b9a-5d96-4fbd-8e2d-a2440225f93a') 30 test.must_not_contain(extra1_manifest, 'e2011457-1546-43c5-a5fe-008deee3d3f0') 31 32 # Must contain both. 33 extra2_manifest = test.built_file_path( 34 'test_manifest_extra2.exe.manifest', chdir=CHDIR) 35 test.must_contain(extra2_manifest, '35138b9a-5d96-4fbd-8e2d-a2440225f93a') 36 test.must_contain(extra2_manifest, 'e2011457-1546-43c5-a5fe-008deee3d3f0') 37 38 # Same as extra2, but using list syntax instead. 39 extra_list_manifest = test.built_file_path( 40 'test_manifest_extra_list.exe.manifest', chdir=CHDIR) 41 test.must_contain(extra_list_manifest, '35138b9a-5d96-4fbd-8e2d-a2440225f93a') 42 test.must_contain(extra_list_manifest, 'e2011457-1546-43c5-a5fe-008deee3d3f0') 43 44 test.pass_test() 45