summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/multiple-targets
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/python/gyp/test/multiple-targets
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/gyp/test/multiple-targets')
-rwxr-xr-xthird_party/python/gyp/test/multiple-targets/gyptest-all.py30
-rwxr-xr-xthird_party/python/gyp/test/multiple-targets/gyptest-default.py30
-rw-r--r--third_party/python/gyp/test/multiple-targets/src/common.c7
-rw-r--r--third_party/python/gyp/test/multiple-targets/src/multiple.gyp24
-rw-r--r--third_party/python/gyp/test/multiple-targets/src/prog1.c10
-rw-r--r--third_party/python/gyp/test/multiple-targets/src/prog2.c10
6 files changed, 111 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/multiple-targets/gyptest-all.py b/third_party/python/gyp/test/multiple-targets/gyptest-all.py
new file mode 100755
index 0000000000..3ef50090d1
--- /dev/null
+++ b/third_party/python/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/third_party/python/gyp/test/multiple-targets/gyptest-default.py b/third_party/python/gyp/test/multiple-targets/gyptest-default.py
new file mode 100755
index 0000000000..db15d794c3
--- /dev/null
+++ b/third_party/python/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/third_party/python/gyp/test/multiple-targets/src/common.c b/third_party/python/gyp/test/multiple-targets/src/common.c
new file mode 100644
index 0000000000..f1df7c1431
--- /dev/null
+++ b/third_party/python/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/third_party/python/gyp/test/multiple-targets/src/multiple.gyp b/third_party/python/gyp/test/multiple-targets/src/multiple.gyp
new file mode 100644
index 0000000000..3db4ea30cd
--- /dev/null
+++ b/third_party/python/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/third_party/python/gyp/test/multiple-targets/src/prog1.c b/third_party/python/gyp/test/multiple-targets/src/prog1.c
new file mode 100644
index 0000000000..fbf8d4cd7c
--- /dev/null
+++ b/third_party/python/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/third_party/python/gyp/test/multiple-targets/src/prog2.c b/third_party/python/gyp/test/multiple-targets/src/prog2.c
new file mode 100644
index 0000000000..a94b5c155e
--- /dev/null
+++ b/third_party/python/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;
+}