diff options
Diffstat (limited to 'media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr')
6 files changed, 104 insertions, 0 deletions
diff --git a/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/dummy.bar b/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/dummy.bar new file mode 100644 index 000000000..25178696d --- /dev/null +++ b/media/webrtc/trunk/tools/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/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/dummy.foo b/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/dummy.foo new file mode 100644 index 000000000..6a7990bb9 --- /dev/null +++ b/media/webrtc/trunk/tools/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/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py b/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py new file mode 100644 index 000000000..804505a23 --- /dev/null +++ b/media/webrtc/trunk/tools/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/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py b/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py new file mode 100644 index 000000000..f4860624f --- /dev/null +++ b/media/webrtc/trunk/tools/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/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py b/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py new file mode 100644 index 000000000..2b58d2a37 --- /dev/null +++ b/media/webrtc/trunk/tools/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/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp b/media/webrtc/trunk/tools/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp new file mode 100644 index 000000000..ce93643f8 --- /dev/null +++ b/media/webrtc/trunk/tools/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)', + ], + }, + ], + }, + ], +} |