summaryrefslogtreecommitdiff
path: root/deps/gyp/test/msvs/rules_stdout_stderr
diff options
context:
space:
mode:
Diffstat (limited to 'deps/gyp/test/msvs/rules_stdout_stderr')
-rw-r--r--deps/gyp/test/msvs/rules_stdout_stderr/dummy.bar5
-rw-r--r--deps/gyp/test/msvs/rules_stdout_stderr/dummy.foo5
-rw-r--r--deps/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py29
-rw-r--r--deps/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py7
-rw-r--r--deps/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py6
-rw-r--r--deps/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp52
6 files changed, 104 insertions, 0 deletions
diff --git a/deps/gyp/test/msvs/rules_stdout_stderr/dummy.bar b/deps/gyp/test/msvs/rules_stdout_stderr/dummy.bar
new file mode 100644
index 0000000000..25178696d2
--- /dev/null
+++ b/deps/gyp/test/msvs/rules_stdout_stderr/dummy.bar
@@ -0,0 +1,5 @@
+# Copyright (c) 2015 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.
+
+A dummy file with the .bar extension (used for stderr rule).
diff --git a/deps/gyp/test/msvs/rules_stdout_stderr/dummy.foo b/deps/gyp/test/msvs/rules_stdout_stderr/dummy.foo
new file mode 100644
index 0000000000..6a7990bb98
--- /dev/null
+++ b/deps/gyp/test/msvs/rules_stdout_stderr/dummy.foo
@@ -0,0 +1,5 @@
+# Copyright (c) 2015 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.
+
+A dummy file with the .foo extension (used for stdout rule).
diff --git a/deps/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py b/deps/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py
new file mode 100644
index 0000000000..804505a23d
--- /dev/null
+++ b/deps/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2015 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 stdout and stderr from rules get logged in the build's
+stdout."""
+
+import sys
+import TestGyp
+
+if sys.platform == 'win32':
+ test = TestGyp.TestGyp(formats=['msvs'])
+
+ test.run_gyp('rules-stdout-stderr.gyp')
+ test.build('rules-stdout-stderr.gyp', test.ALL)
+
+ expected_stdout_lines = [
+ 'testing stdout',
+ 'This will go to stdout',
+
+ # Note: stderr output from rules will go to the build's stdout.
+ 'testing stderr',
+ 'This will go to stderr',
+ ]
+ test.must_contain_all_lines(test.stdout(), expected_stdout_lines)
+
+ test.pass_test()
diff --git a/deps/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py b/deps/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py
new file mode 100644
index 0000000000..f4860624f3
--- /dev/null
+++ b/deps/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+# Copyright (c) 2015 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
+print >>sys.stderr, "This will go to stderr"
diff --git a/deps/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py b/deps/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py
new file mode 100644
index 0000000000..2b58d2a374
--- /dev/null
+++ b/deps/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+# Copyright (c) 2015 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.
+
+print "This will go to stdout"
diff --git a/deps/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp b/deps/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp
new file mode 100644
index 0000000000..ce93643f8e
--- /dev/null
+++ b/deps/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp
@@ -0,0 +1,52 @@
+# Copyright (c) 2015 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': 'test',
+ 'type': 'none',
+ 'sources': [
+ 'dummy.foo',
+ 'dummy.bar',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'test_stdout',
+ 'extension': 'foo',
+ 'message': 'testing stdout',
+ 'msvs_cygwin_shell': 0,
+ 'inputs': [
+ 'rule_stdout.py',
+ ],
+ 'outputs': [
+ 'dummy.foo_output',
+ ],
+ 'action': [
+ 'python',
+ 'rule_stdout.py',
+ '<(RULE_INPUT_PATH)',
+ ],
+ },
+ {
+ 'rule_name': 'test_stderr',
+ 'extension': 'bar',
+ 'message': 'testing stderr',
+ 'msvs_cygwin_shell': 0,
+ 'inputs': [
+ 'rule_stderr.py',
+ ],
+ 'outputs': [
+ 'dummy.bar_output',
+ ],
+ 'action': [
+ 'python',
+ 'rule_stderr.py',
+ '<(RULE_INPUT_PATH)',
+ ],
+ },
+ ],
+ },
+ ],
+}