summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/msvs/shared_output
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/python/gyp/test/msvs/shared_output')
-rw-r--r--third_party/python/gyp/test/msvs/shared_output/common.gypi17
-rw-r--r--third_party/python/gyp/test/msvs/shared_output/gyptest-shared_output.py41
-rw-r--r--third_party/python/gyp/test/msvs/shared_output/hello.c12
-rw-r--r--third_party/python/gyp/test/msvs/shared_output/hello.gyp21
-rw-r--r--third_party/python/gyp/test/msvs/shared_output/there/there.c12
-rw-r--r--third_party/python/gyp/test/msvs/shared_output/there/there.gyp16
6 files changed, 119 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/msvs/shared_output/common.gypi b/third_party/python/gyp/test/msvs/shared_output/common.gypi
new file mode 100644
index 0000000000..c6fa341d68
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/shared_output/common.gypi
@@ -0,0 +1,17 @@
+# 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.
+
+{
+ 'target_defaults': {
+ 'default_configuration': 'Baz',
+ 'configurations': {
+ 'Baz': {
+ 'msvs_configuration_attributes': {
+ 'OutputDirectory': '<(DEPTH)/foo',
+ 'IntermediateDirectory': '$(OutDir)/bar',
+ },
+ },
+ },
+ },
+}
diff --git a/third_party/python/gyp/test/msvs/shared_output/gyptest-shared_output.py b/third_party/python/gyp/test/msvs/shared_output/gyptest-shared_output.py
new file mode 100644
index 0000000000..270b280e6b
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/shared_output/gyptest-shared_output.py
@@ -0,0 +1,41 @@
+#!/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.
+
+"""
+Test checking that IntermediateDirectory can be defined in terms of
+OutputDirectory. We previously had emitted the definition of
+IntermediateDirectory before the definition of OutputDirectory.
+This is required so that $(IntDir) can be based on $(OutDir).
+"""
+
+import TestGyp
+import os
+
+# NOTE: This test really is vcbuild/msbuild specific (not applicable to windows
+# ninja), as it is testing the msvs output location when opening an .sln
+# other than all.sln.
+test = TestGyp.TestGyp(workdir='workarea_shared_output', formats=['msvs'])
+
+test.run_gyp('hello.gyp')
+test.set_configuration('Baz')
+
+test.build('there/there.gyp', test.ALL)
+test.must_exist(os.path.join(test.workdir, 'foo', 'there.exe'))
+test.must_exist(os.path.join(test.workdir, 'foo', 'bar', 'there.obj'))
+
+test.build('hello.gyp', test.ALL)
+test.must_exist(os.path.join(test.workdir, 'foo', 'hello.exe'))
+test.must_exist(os.path.join(test.workdir, 'foo', 'bar', 'hello.obj'))
+
+if test.format == 'msvs':
+ if test.uses_msbuild:
+ test.must_contain('pull_in_there.vcxproj',
+ '<IntDir>$(OutDir)bar\\</IntDir>')
+ else:
+ test.must_contain('pull_in_there.vcproj',
+ 'IntermediateDirectory="$(OutDir)bar\\"')
+
+test.pass_test()
diff --git a/third_party/python/gyp/test/msvs/shared_output/hello.c b/third_party/python/gyp/test/msvs/shared_output/hello.c
new file mode 100644
index 0000000000..698e4fd36c
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/shared_output/hello.c
@@ -0,0 +1,12 @@
+/*
+ * 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/shared_output/hello.gyp b/third_party/python/gyp/test/msvs/shared_output/hello.gyp
new file mode 100644
index 0000000000..f80e5cfca1
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/shared_output/hello.gyp
@@ -0,0 +1,21 @@
+# 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.
+
+{
+ 'includes': ['common.gypi'],
+ 'targets': [
+ {
+ 'target_name': 'pull_in_there',
+ 'type': 'none',
+ 'dependencies': ['there/there.gyp:*'],
+ },
+ {
+ 'target_name': 'hello',
+ 'type': 'executable',
+ 'sources': [
+ 'hello.c',
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/msvs/shared_output/there/there.c b/third_party/python/gyp/test/msvs/shared_output/there/there.c
new file mode 100644
index 0000000000..698e4fd36c
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/shared_output/there/there.c
@@ -0,0 +1,12 @@
+/*
+ * 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/shared_output/there/there.gyp b/third_party/python/gyp/test/msvs/shared_output/there/there.gyp
new file mode 100644
index 0000000000..56feff326c
--- /dev/null
+++ b/third_party/python/gyp/test/msvs/shared_output/there/there.gyp
@@ -0,0 +1,16 @@
+# 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.
+
+{
+ 'includes': ['../common.gypi'],
+ 'targets': [
+ {
+ 'target_name': 'there',
+ 'type': 'executable',
+ 'sources': [
+ 'there.c',
+ ],
+ },
+ ],
+}