Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame^] | 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 | Verifies that msvs_list_excluded_files=0 doesn't list files that would |
| 9 | normally be in _excluded_files, and that if that flag is not set, then they |
| 10 | are still listed. |
| 11 | """ |
| 12 | |
| 13 | import os |
| 14 | import TestGyp |
| 15 | |
| 16 | test = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all') |
| 17 | |
| 18 | |
| 19 | # with the flag set to 0 |
| 20 | try: |
| 21 | os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_list_excluded_files=0' |
| 22 | test.run_gyp('hello_exclude.gyp') |
| 23 | finally: |
| 24 | del os.environ['GYP_GENERATOR_FLAGS'] |
| 25 | if test.uses_msbuild: |
| 26 | test.must_not_contain('hello.vcxproj', 'hello_mac') |
| 27 | else: |
| 28 | test.must_not_contain('hello.vcproj', 'hello_mac') |
| 29 | |
| 30 | |
| 31 | # with the flag not set |
| 32 | test.run_gyp('hello_exclude.gyp') |
| 33 | if test.uses_msbuild: |
| 34 | test.must_contain('hello.vcxproj', 'hello_mac') |
| 35 | else: |
| 36 | test.must_contain('hello.vcproj', 'hello_mac') |
| 37 | |
| 38 | |
| 39 | # with the flag explicitly set to 1 |
| 40 | try: |
| 41 | os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_list_excluded_files=1' |
| 42 | test.run_gyp('hello_exclude.gyp') |
| 43 | finally: |
| 44 | del os.environ['GYP_GENERATOR_FLAGS'] |
| 45 | if test.uses_msbuild: |
| 46 | test.must_contain('hello.vcxproj', 'hello_mac') |
| 47 | else: |
| 48 | test.must_contain('hello.vcproj', 'hello_mac') |
| 49 | |
| 50 | |
| 51 | test.pass_test() |