diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /media/webrtc/trunk/tools/gyp/test/errors/gyptest-errors.py | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'media/webrtc/trunk/tools/gyp/test/errors/gyptest-errors.py')
-rwxr-xr-x | media/webrtc/trunk/tools/gyp/test/errors/gyptest-errors.py | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/media/webrtc/trunk/tools/gyp/test/errors/gyptest-errors.py b/media/webrtc/trunk/tools/gyp/test/errors/gyptest-errors.py new file mode 100755 index 000000000..0296f800f --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/errors/gyptest-errors.py @@ -0,0 +1,80 @@ +#!/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. + +""" +Test that two targets with the same name generates an error. +""" + +import os +import sys + +import TestGyp +import TestCmd + +# TODO(sbc): Remove the use of match_re below, done because scons +# error messages were not consistent with other generators. +# Also remove input.py:generator_wants_absolute_build_file_paths. + +test = TestGyp.TestGyp() + +stderr = ('gyp: Duplicate target definitions for ' + '.*duplicate_targets.gyp:foo#target\n') +test.run_gyp('duplicate_targets.gyp', status=1, stderr=stderr, + match=TestCmd.match_re) + +stderr = ('.*: Unable to find targets in build file .*missing_targets.gyp.*') +test.run_gyp('missing_targets.gyp', status=1, stderr=stderr, + match=TestCmd.match_re_dotall) + +stderr = ('gyp: rule bar exists in duplicate, target ' + '.*duplicate_rule.gyp:foo#target\n') +test.run_gyp('duplicate_rule.gyp', status=1, stderr=stderr, + match=TestCmd.match_re) + +stderr = ("gyp: Key 'targets' repeated at level 1 with key path '' while " + "reading .*duplicate_node.gyp.*") +test.run_gyp('duplicate_node.gyp', '--check', status=1, stderr=stderr, + match=TestCmd.match_re_dotall) + +stderr = (".*target0.*target1.*target2.*target0.*") +test.run_gyp('dependency_cycle.gyp', status=1, stderr=stderr, + match=TestCmd.match_re_dotall) + +stderr = (".*file_cycle0.*file_cycle1.*file_cycle0.*") +test.run_gyp('file_cycle0.gyp', status=1, stderr=stderr, + match=TestCmd.match_re_dotall) + +stderr = 'gyp: Duplicate basenames in sources section, see list above\n' +test.run_gyp('duplicate_basenames.gyp', status=1, stderr=stderr) + +# Check if '--no-duplicate-basename-check' works. +if ((test.format == 'make' and sys.platform == 'darwin') or + (test.format == 'msvs' and + int(os.environ.get('GYP_MSVS_VERSION', 2010)) < 2010)): + stderr = 'gyp: Duplicate basenames in sources section, see list above\n' + test.run_gyp('duplicate_basenames.gyp', '--no-duplicate-basename-check', + status=1, stderr=stderr) +else: + test.run_gyp('duplicate_basenames.gyp', '--no-duplicate-basename-check') + +stderr = ("gyp: Dependency '.*missing_dep.gyp:missing.gyp#target' not found " + "while trying to load target .*missing_dep.gyp:foo#target\n") +test.run_gyp('missing_dep.gyp', status=1, stderr=stderr, + match=TestCmd.match_re) + +# Make sure invalid <!() command invocations say what command it was and +# mention the gyp file name. Use a "random" command name to trigger an ENOENT. +stderr = (".*invalid-command-name-egtyevNif3.*netDurj9.*missing_command.gyp.*") +test.run_gyp('missing_command.gyp', status=1, stderr=stderr, + match=TestCmd.match_re_dotall) + +# Make sure <!() commands that error out result in a message that mentions +# the command and gyp file name +stderr = (".*python.*-c.*import sys.*sys.exit.*3.*error_command.gyp.*") +test.run_gyp('error_command.gyp', status=1, stderr=stderr, + match=TestCmd.match_re_dotall) + +test.pass_test() |