- add third_party src.
[platform/framework/web/crosswalk.git] / src / tools / gyp / test / errors / gyptest-errors.py
1 #!/usr/bin/env python
2
3 # Copyright (c) 2012 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """
8 Test that two targets with the same name generates an error.
9 """
10
11 import TestGyp
12 import TestCmd
13
14 # TODO(sbc): Remove the use of match_re below, done because scons
15 # error messages were not consistent with other generators.
16 # Also remove input.py:generator_wants_absolute_build_file_paths.
17
18 test = TestGyp.TestGyp()
19
20 stderr = ('gyp: Duplicate target definitions for '
21           '.*duplicate_targets.gyp:foo#target\n')
22 test.run_gyp('duplicate_targets.gyp', status=1, stderr=stderr,
23              match=TestCmd.match_re)
24
25 stderr = ('.*: Unable to find targets in build file .*missing_targets.gyp.*')
26 test.run_gyp('missing_targets.gyp', status=1, stderr=stderr,
27              match=TestCmd.match_re_dotall)
28
29 stderr = ('gyp: rule bar exists in duplicate, target '
30           '.*duplicate_rule.gyp:foo#target\n')
31 test.run_gyp('duplicate_rule.gyp', status=1, stderr=stderr,
32              match=TestCmd.match_re)
33
34 stderr = ("gyp: Key 'targets' repeated at level 1 with key path '' while "
35           "reading .*duplicate_node.gyp.*")
36 test.run_gyp('duplicate_node.gyp', '--check', status=1, stderr=stderr,
37              match=TestCmd.match_re_dotall)
38
39 stderr = 'gyp: Duplicate basenames in sources section, see list above\n'
40 test.run_gyp('duplicate_basenames.gyp', status=1, stderr=stderr)
41
42 stderr = ("gyp: Dependency '.*missing_dep.gyp:missing.gyp#target' not found "
43           "while trying to load target .*missing_dep.gyp:foo#target\n")
44 test.run_gyp('missing_dep.gyp', status=1, stderr=stderr,
45              match=TestCmd.match_re)
46
47 test.pass_test()