summaryrefslogtreecommitdiff
path: root/deps/gyp/test/link-objects
diff options
context:
space:
mode:
Diffstat (limited to 'deps/gyp/test/link-objects')
-rw-r--r--deps/gyp/test/link-objects/base.c6
-rw-r--r--deps/gyp/test/link-objects/extra.c5
-rwxr-xr-xdeps/gyp/test/link-objects/gyptest-all.py28
-rw-r--r--deps/gyp/test/link-objects/link-objects.gyp24
4 files changed, 63 insertions, 0 deletions
diff --git a/deps/gyp/test/link-objects/base.c b/deps/gyp/test/link-objects/base.c
new file mode 100644
index 0000000000..3327459205
--- /dev/null
+++ b/deps/gyp/test/link-objects/base.c
@@ -0,0 +1,6 @@
+void extra();
+
+int main(void) {
+ extra();
+ return 0;
+}
diff --git a/deps/gyp/test/link-objects/extra.c b/deps/gyp/test/link-objects/extra.c
new file mode 100644
index 0000000000..1d7ee09b10
--- /dev/null
+++ b/deps/gyp/test/link-objects/extra.c
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+void extra() {
+ printf("PASS\n");
+}
diff --git a/deps/gyp/test/link-objects/gyptest-all.py b/deps/gyp/test/link-objects/gyptest-all.py
new file mode 100755
index 0000000000..45bd6e1891
--- /dev/null
+++ b/deps/gyp/test/link-objects/gyptest-all.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2011 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.
+
+"""
+Put an object file on the sources list.
+Expect the result to link ok.
+"""
+
+import TestGyp
+
+import sys
+
+if sys.platform != 'darwin':
+ # Currently only works under the linux make build.
+ test = TestGyp.TestGyp(formats=['make'])
+
+ test.run_gyp('link-objects.gyp')
+
+ test.build('link-objects.gyp', test.ALL)
+
+ test.run_built_executable('link-objects', stdout="PASS\n")
+
+ test.up_to_date('link-objects.gyp', test.ALL)
+
+ test.pass_test()
diff --git a/deps/gyp/test/link-objects/link-objects.gyp b/deps/gyp/test/link-objects/link-objects.gyp
new file mode 100644
index 0000000000..ab72855531
--- /dev/null
+++ b/deps/gyp/test/link-objects/link-objects.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': 'link-objects',
+ 'type': 'executable',
+ 'actions': [
+ {
+ 'action_name': 'build extra object',
+ 'inputs': ['extra.c'],
+ 'outputs': ['extra.o'],
+ 'action': ['gcc', '-o', 'extra.o', '-c', 'extra.c'],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ 'sources': [
+ 'base.c',
+ ],
+ },
+ ],
+}