summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/actions-none
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/python/gyp/test/actions-none')
-rwxr-xr-xthird_party/python/gyp/test/actions-none/gyptest-none.py24
-rw-r--r--third_party/python/gyp/test/actions-none/src/fake_cross.py12
-rw-r--r--third_party/python/gyp/test/actions-none/src/foo.cc1
-rw-r--r--third_party/python/gyp/test/actions-none/src/none_with_source_files.gyp35
4 files changed, 72 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/actions-none/gyptest-none.py b/third_party/python/gyp/test/actions-none/gyptest-none.py
new file mode 100755
index 0000000000..933cfad30c
--- /dev/null
+++ b/third_party/python/gyp/test/actions-none/gyptest-none.py
@@ -0,0 +1,24 @@
+#!/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.
+
+"""
+Verifies actions can be in 'none' type targets with source files.
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+test.run_gyp('none_with_source_files.gyp', chdir='src')
+
+test.relocate('src', 'relocate/src')
+test.build('none_with_source_files.gyp', chdir='relocate/src')
+
+file_content = 'foo.cc\n'
+
+test.built_file_must_match('fake.out', file_content, chdir='relocate/src')
+
+test.pass_test()
diff --git a/third_party/python/gyp/test/actions-none/src/fake_cross.py b/third_party/python/gyp/test/actions-none/src/fake_cross.py
new file mode 100644
index 0000000000..a03ea87fc9
--- /dev/null
+++ b/third_party/python/gyp/test/actions-none/src/fake_cross.py
@@ -0,0 +1,12 @@
+#!/usr/bin/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.
+
+
+import sys
+
+fh = open(sys.argv[-1], 'w')
+for filename in sys.argv[1:-1]:
+ fh.write(open(filename).read())
+fh.close()
diff --git a/third_party/python/gyp/test/actions-none/src/foo.cc b/third_party/python/gyp/test/actions-none/src/foo.cc
new file mode 100644
index 0000000000..c6c61745ba
--- /dev/null
+++ b/third_party/python/gyp/test/actions-none/src/foo.cc
@@ -0,0 +1 @@
+foo.cc
diff --git a/third_party/python/gyp/test/actions-none/src/none_with_source_files.gyp b/third_party/python/gyp/test/actions-none/src/none_with_source_files.gyp
new file mode 100644
index 0000000000..e2aaebc10a
--- /dev/null
+++ b/third_party/python/gyp/test/actions-none/src/none_with_source_files.gyp
@@ -0,0 +1,35 @@
+# 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 that 'none' type targets can have .cc files in them.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'none_with_sources',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'foo.cc',
+ ],
+ 'actions': [
+ {
+ 'action_name': 'fake_cross',
+ 'inputs': [
+ 'fake_cross.py',
+ '<@(_sources)',
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/fake.out',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<@(_outputs)',
+ ],
+ # Allows the test to run without hermetic cygwin on windows.
+ 'msvs_cygwin_shell': 0,
+ }
+ ],
+ },
+ ],
+}