summaryrefslogtreecommitdiff
path: root/deps/gyp/test/multiple-targets
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-12-04 13:29:51 -0500
committerMike Morris <michael.patrick.morris@gmail.com>2015-12-07 15:48:34 -0800
commitd467ae6e7867044b8d7b466776fb37089292c52b (patch)
tree730ee0656e6bf9f0dff33346f07acd800e83ab25 /deps/gyp/test/multiple-targets
parent59ef8da69549cf6308078c6f656affba96e9439e (diff)
downloadqtlocation-mapboxgl-d467ae6e7867044b8d7b466776fb37089292c52b.tar.gz
[core] upgrade gyp to git commit 6fb8bd8
https://chromium.googlesource.com/external/gyp/+/6fb8bd829f0ca8fd432fd85ede788b6881c4f09f
Diffstat (limited to 'deps/gyp/test/multiple-targets')
-rwxr-xr-xdeps/gyp/test/multiple-targets/gyptest-all.py30
-rwxr-xr-xdeps/gyp/test/multiple-targets/gyptest-default.py30
-rw-r--r--deps/gyp/test/multiple-targets/src/common.c7
-rw-r--r--deps/gyp/test/multiple-targets/src/multiple.gyp24
-rw-r--r--deps/gyp/test/multiple-targets/src/prog1.c10
-rw-r--r--deps/gyp/test/multiple-targets/src/prog2.c10
6 files changed, 111 insertions, 0 deletions
diff --git a/deps/gyp/test/multiple-targets/gyptest-all.py b/deps/gyp/test/multiple-targets/gyptest-all.py
new file mode 100755
index 0000000000..3ef50090d1
--- /dev/null
+++ b/deps/gyp/test/multiple-targets/gyptest-all.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2009 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.
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+test.run_gyp('multiple.gyp', chdir='src')
+
+test.relocate('src', 'relocate/src')
+
+test.build('multiple.gyp', test.ALL, chdir='relocate/src', stderr=None)
+
+expect1 = """\
+hello from prog1.c
+hello from common.c
+"""
+
+expect2 = """\
+hello from prog2.c
+hello from common.c
+"""
+
+test.run_built_executable('prog1', stdout=expect1, chdir='relocate/src')
+test.run_built_executable('prog2', stdout=expect2, chdir='relocate/src')
+
+test.pass_test()
diff --git a/deps/gyp/test/multiple-targets/gyptest-default.py b/deps/gyp/test/multiple-targets/gyptest-default.py
new file mode 100755
index 0000000000..db15d794c3
--- /dev/null
+++ b/deps/gyp/test/multiple-targets/gyptest-default.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2009 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.
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+test.run_gyp('multiple.gyp', chdir='src')
+
+test.relocate('src', 'relocate/src')
+
+test.build('multiple.gyp', chdir='relocate/src')
+
+expect1 = """\
+hello from prog1.c
+hello from common.c
+"""
+
+expect2 = """\
+hello from prog2.c
+hello from common.c
+"""
+
+test.run_built_executable('prog1', stdout=expect1, chdir='relocate/src')
+test.run_built_executable('prog2', stdout=expect2, chdir='relocate/src')
+
+test.pass_test()
diff --git a/deps/gyp/test/multiple-targets/src/common.c b/deps/gyp/test/multiple-targets/src/common.c
new file mode 100644
index 0000000000..f1df7c1431
--- /dev/null
+++ b/deps/gyp/test/multiple-targets/src/common.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+void common(void)
+{
+ printf("hello from common.c\n");
+ return;
+}
diff --git a/deps/gyp/test/multiple-targets/src/multiple.gyp b/deps/gyp/test/multiple-targets/src/multiple.gyp
new file mode 100644
index 0000000000..3db4ea30cd
--- /dev/null
+++ b/deps/gyp/test/multiple-targets/src/multiple.gyp
@@ -0,0 +1,24 @@
+# Copyright (c) 2009 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': 'prog1',
+ 'type': 'executable',
+ 'sources': [
+ 'prog1.c',
+ 'common.c',
+ ],
+ },
+ {
+ 'target_name': 'prog2',
+ 'type': 'executable',
+ 'sources': [
+ 'prog2.c',
+ 'common.c',
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/multiple-targets/src/prog1.c b/deps/gyp/test/multiple-targets/src/prog1.c
new file mode 100644
index 0000000000..fbf8d4cd7c
--- /dev/null
+++ b/deps/gyp/test/multiple-targets/src/prog1.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+extern void common(void);
+
+int main(void)
+{
+ printf("hello from prog1.c\n");
+ common();
+ return 0;
+}
diff --git a/deps/gyp/test/multiple-targets/src/prog2.c b/deps/gyp/test/multiple-targets/src/prog2.c
new file mode 100644
index 0000000000..a94b5c155e
--- /dev/null
+++ b/deps/gyp/test/multiple-targets/src/prog2.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+extern void common(void);
+
+int main(void)
+{
+ printf("hello from prog2.c\n");
+ common();
+ return 0;
+}