summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/msvs/list_excluded
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/python/gyp/test/msvs/list_excluded')
-rw-r--r--third_party/python/gyp/test/msvs/list_excluded/gyptest-all.py51
-rw-r--r--third_party/python/gyp/test/msvs/list_excluded/hello.cpp10
-rw-r--r--third_party/python/gyp/test/msvs/list_excluded/hello_exclude.gyp19
-rw-r--r--third_party/python/gyp/test/msvs/list_excluded/hello_mac.cpp10
4 files changed, 90 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/msvs/list_excluded/gyptest-all.py b/third_party/python/gyp/test/msvs/list_excluded/gyptest-all.py
new file mode 100644
index 0000000000..5a370f6b47
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/list_excluded/gyptest-all.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies that msvs_list_excluded_files=0 doesn't list files that would
+normally be in _excluded_files, and that if that flag is not set, then they
+are still listed.
+"""
+
+import os
+import TestGyp
+
+test = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all')
+
+
+# with the flag set to 0
+try:
+ os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_list_excluded_files=0'
+ test.run_gyp('hello_exclude.gyp')
+finally:
+ del os.environ['GYP_GENERATOR_FLAGS']
+if test.uses_msbuild:
+ test.must_not_contain('hello.vcxproj', 'hello_mac')
+else:
+ test.must_not_contain('hello.vcproj', 'hello_mac')
+
+
+# with the flag not set
+test.run_gyp('hello_exclude.gyp')
+if test.uses_msbuild:
+ test.must_contain('hello.vcxproj', 'hello_mac')
+else:
+ test.must_contain('hello.vcproj', 'hello_mac')
+
+
+# with the flag explicitly set to 1
+try:
+ os.environ['GYP_GENERATOR_FLAGS'] = 'msvs_list_excluded_files=1'
+ test.run_gyp('hello_exclude.gyp')
+finally:
+ del os.environ['GYP_GENERATOR_FLAGS']
+if test.uses_msbuild:
+ test.must_contain('hello.vcxproj', 'hello_mac')
+else:
+ test.must_contain('hello.vcproj', 'hello_mac')
+
+
+test.pass_test()
diff --git a/third_party/python/gyp/test/msvs/list_excluded/hello.cpp b/third_party/python/gyp/test/msvs/list_excluded/hello.cpp
new file mode 100644
index 0000000000..bc0c0265b5
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/list_excluded/hello.cpp
@@ -0,0 +1,10 @@
+// Copyright (c) 2012 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stdio.h>
+
+int main(void) {
+ printf("Hello, world!\n");
+ return 0;
+}
diff --git a/third_party/python/gyp/test/msvs/list_excluded/hello_exclude.gyp b/third_party/python/gyp/test/msvs/list_excluded/hello_exclude.gyp
new file mode 100644
index 0000000000..aa160f2367
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/list_excluded/hello_exclude.gyp
@@ -0,0 +1,19 @@
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'hello',
+ 'type': 'executable',
+ 'sources': [
+ 'hello.cpp',
+ 'hello_mac.cpp',
+ ],
+ 'conditions': [
+ ['OS!="mac"', {'sources!': ['hello_mac.cpp']}],
+ ]
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/msvs/list_excluded/hello_mac.cpp b/third_party/python/gyp/test/msvs/list_excluded/hello_mac.cpp
new file mode 100644
index 0000000000..b9f6242c4b
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/list_excluded/hello_mac.cpp
@@ -0,0 +1,10 @@
+// Copyright (c) 2012 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stdio.h>
+
+int hello2() {
+ printf("Hello, two!\n");
+ return 0;
+}