summaryrefslogtreecommitdiff
path: root/deps/gyp/test/sanitize-rule-names
diff options
context:
space:
mode:
Diffstat (limited to 'deps/gyp/test/sanitize-rule-names')
-rw-r--r--deps/gyp/test/sanitize-rule-names/blah.S0
-rw-r--r--deps/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py17
-rw-r--r--deps/gyp/test/sanitize-rule-names/hello.cc7
-rw-r--r--deps/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp27
-rw-r--r--deps/gyp/test/sanitize-rule-names/script.py10
5 files changed, 61 insertions, 0 deletions
diff --git a/deps/gyp/test/sanitize-rule-names/blah.S b/deps/gyp/test/sanitize-rule-names/blah.S
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/deps/gyp/test/sanitize-rule-names/blah.S
diff --git a/deps/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py b/deps/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py
new file mode 100644
index 0000000000..968a0ce5ce
--- /dev/null
+++ b/deps/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py
@@ -0,0 +1,17 @@
+#!/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.
+
+"""
+Make sure rule names with non-"normal" characters in them don't cause
+broken build files. This test was originally causing broken .ninja files.
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+test.run_gyp('sanitize-rule-names.gyp')
+test.build('sanitize-rule-names.gyp', test.ALL)
+test.pass_test()
diff --git a/deps/gyp/test/sanitize-rule-names/hello.cc b/deps/gyp/test/sanitize-rule-names/hello.cc
new file mode 100644
index 0000000000..1711567ef5
--- /dev/null
+++ b/deps/gyp/test/sanitize-rule-names/hello.cc
@@ -0,0 +1,7 @@
+// 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.
+
+int main() {
+ return 0;
+}
diff --git a/deps/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp b/deps/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp
new file mode 100644
index 0000000000..184253e966
--- /dev/null
+++ b/deps/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp
@@ -0,0 +1,27 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 's_test',
+ 'type': 'executable',
+ 'rules': [
+ {
+ # Make sure this rule name doesn't cause an invalid ninja file.
+ 'rule_name': 'rule name with odd characters ()/',
+ 'extension': 'S',
+ 'outputs': ['outfile'],
+ 'msvs_cygwin_shell': 0,
+ 'msvs_quote_cmd': 0,
+ 'action': ['python', 'script.py', '<(RULE_INPUT_PATH)', 'outfile'],
+ },
+ ],
+ 'sources': [
+ 'blah.S',
+ 'hello.cc',
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/sanitize-rule-names/script.py b/deps/gyp/test/sanitize-rule-names/script.py
new file mode 100644
index 0000000000..ae2efa1df4
--- /dev/null
+++ b/deps/gyp/test/sanitize-rule-names/script.py
@@ -0,0 +1,10 @@
+#!/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.
+
+import shutil
+import sys
+
+shutil.copyfile(*sys.argv[1:])