148d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org#!/usr/bin/env python
248d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
348d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org# Copyright (c) 2012 Google Inc. All rights reserved.
448d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org# Use of this source code is governed by a BSD-style license that can be
548d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org# found in the LICENSE file.
648d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
748d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org"""
848d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgVerifies that msvs_list_excluded_files=0 doesn't list files that would
948d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgnormally be in _excluded_files, and that if that flag is not set, then they
1048d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgare still listed.
1148d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org"""
1248d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
1348d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgimport os
1448d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgimport TestGyp
1548d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
1648d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgtest = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all')
1748d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
1848d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
1948d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org# with the flag set to 0
2048d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgtry:
2148d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_list_excluded_files=0'
2248d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  test.run_gyp('hello_exclude.gyp')
2348d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgfinally:
2448d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  del os.environ['GYP_GENERATOR_FLAGS']
2548d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgif test.uses_msbuild:
2648d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  test.must_not_contain('hello.vcxproj', 'hello_mac')
2748d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgelse:
2848d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  test.must_not_contain('hello.vcproj', 'hello_mac')
2948d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
3048d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
3148d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org# with the flag not set
3248d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgtest.run_gyp('hello_exclude.gyp')
3348d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgif test.uses_msbuild:
3448d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  test.must_contain('hello.vcxproj', 'hello_mac')
3548d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgelse:
3648d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  test.must_contain('hello.vcproj', 'hello_mac')
3748d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
3848d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
3948d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org# with the flag explicitly set to 1
4048d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgtry:
4148d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_list_excluded_files=1'
4248d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  test.run_gyp('hello_exclude.gyp')
4348d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgfinally:
4448d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  del os.environ['GYP_GENERATOR_FLAGS']
4548d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgif test.uses_msbuild:
4648d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  test.must_contain('hello.vcxproj', 'hello_mac')
4748d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgelse:
4848d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org  test.must_contain('hello.vcproj', 'hello_mac')
4948d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
5048d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.org
5148d1e6b57f4f67771b54bfa070102d118bd97491scottmg@chromium.orgtest.pass_test()
52