summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/compilable
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/python/gyp/test/compilable
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/gyp/test/compilable')
-rwxr-xr-xthird_party/python/gyp/test/compilable/gyptest-headers.py29
-rw-r--r--third_party/python/gyp/test/compilable/src/headers.gyp26
-rw-r--r--third_party/python/gyp/test/compilable/src/lib1.cpp7
-rw-r--r--third_party/python/gyp/test/compilable/src/lib1.hpp6
-rw-r--r--third_party/python/gyp/test/compilable/src/program.cpp9
5 files changed, 77 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/compilable/gyptest-headers.py b/third_party/python/gyp/test/compilable/gyptest-headers.py
new file mode 100755
index 0000000000..91760216fb
--- /dev/null
+++ b/third_party/python/gyp/test/compilable/gyptest-headers.py
@@ -0,0 +1,29 @@
+#!/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.
+
+"""
+Verifies that .hpp files are ignored when included in the source list on all
+platforms.
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+test.run_gyp('headers.gyp', chdir='src')
+
+test.relocate('src', 'relocate/src')
+
+test.build('headers.gyp', test.ALL, chdir='relocate/src')
+
+expect = """\
+Hello from program.c
+Hello from lib1.c
+"""
+test.run_built_executable('program', chdir='relocate/src', stdout=expect)
+
+
+test.pass_test()
diff --git a/third_party/python/gyp/test/compilable/src/headers.gyp b/third_party/python/gyp/test/compilable/src/headers.gyp
new file mode 100644
index 0000000000..b6c2a8857b
--- /dev/null
+++ b/third_party/python/gyp/test/compilable/src/headers.gyp
@@ -0,0 +1,26 @@
+# 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': 'program',
+ 'type': 'executable',
+ 'dependencies': [
+ 'lib1'
+ ],
+ 'sources': [
+ 'program.cpp',
+ ],
+ },
+ {
+ 'target_name': 'lib1',
+ 'type': 'static_library',
+ 'sources': [
+ 'lib1.hpp',
+ 'lib1.cpp',
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/compilable/src/lib1.cpp b/third_party/python/gyp/test/compilable/src/lib1.cpp
new file mode 100644
index 0000000000..51bc31a40b
--- /dev/null
+++ b/third_party/python/gyp/test/compilable/src/lib1.cpp
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include "lib1.hpp"
+
+void lib1_function(void) {
+ fprintf(stdout, "Hello from lib1.c\n");
+ fflush(stdout);
+}
diff --git a/third_party/python/gyp/test/compilable/src/lib1.hpp b/third_party/python/gyp/test/compilable/src/lib1.hpp
new file mode 100644
index 0000000000..72e63e8acd
--- /dev/null
+++ b/third_party/python/gyp/test/compilable/src/lib1.hpp
@@ -0,0 +1,6 @@
+#ifndef _lib1_hpp
+#define _lib1_hpp
+
+extern void lib1_function(void);
+
+#endif
diff --git a/third_party/python/gyp/test/compilable/src/program.cpp b/third_party/python/gyp/test/compilable/src/program.cpp
new file mode 100644
index 0000000000..8af2c9b6ff
--- /dev/null
+++ b/third_party/python/gyp/test/compilable/src/program.cpp
@@ -0,0 +1,9 @@
+#include <stdio.h>
+#include "lib1.hpp"
+
+int main(void) {
+ fprintf(stdout, "Hello from program.c\n");
+ fflush(stdout);
+ lib1_function();
+ return 0;
+}