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