~hjd/ubuntu/wily/gyp/debian-merged

« back to all changes in this revision

Viewing changes to test/errors/gyptest-errors.py

  • Committer: Hans Joachim Desserud
  • Date: 2015-10-31 12:46:59 UTC
  • mfrom: (6.2.6 sid)
  • Revision ID: hans_joachim_desserud-20151031124659-lzxekr6woskh4k0b
Merge latest Debian version

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
Test that two targets with the same name generates an error.
9
9
"""
10
10
 
 
11
import os
 
12
import sys
 
13
 
11
14
import TestGyp
12
15
import TestCmd
13
16
 
22
25
test.run_gyp('duplicate_targets.gyp', status=1, stderr=stderr,
23
26
             match=TestCmd.match_re)
24
27
 
25
 
stderr = ('gyp: Unable to find targets in build file .*missing_targets.gyp '
26
 
          'while trying to load missing_targets.gyp\n')
 
28
stderr = ('.*: Unable to find targets in build file .*missing_targets.gyp.*')
27
29
test.run_gyp('missing_targets.gyp', status=1, stderr=stderr,
28
 
             match=TestCmd.match_re)
 
30
             match=TestCmd.match_re_dotall)
29
31
 
30
32
stderr = ('gyp: rule bar exists in duplicate, target '
31
33
          '.*duplicate_rule.gyp:foo#target\n')
33
35
             match=TestCmd.match_re)
34
36
 
35
37
stderr = ("gyp: Key 'targets' repeated at level 1 with key path '' while "
36
 
          "reading .*duplicate_node.gyp while trying to load "
37
 
          "duplicate_node.gyp\n")
 
38
          "reading .*duplicate_node.gyp.*")
38
39
test.run_gyp('duplicate_node.gyp', '--check', status=1, stderr=stderr,
39
 
             match=TestCmd.match_re)
 
40
             match=TestCmd.match_re_dotall)
 
41
 
 
42
stderr = (".*target0.*target1.*target2.*target0.*")
 
43
test.run_gyp('dependency_cycle.gyp', status=1, stderr=stderr,
 
44
             match=TestCmd.match_re_dotall)
 
45
 
 
46
stderr = (".*file_cycle0.*file_cycle1.*file_cycle0.*")
 
47
test.run_gyp('file_cycle0.gyp', status=1, stderr=stderr,
 
48
             match=TestCmd.match_re_dotall)
40
49
 
41
50
stderr = 'gyp: Duplicate basenames in sources section, see list above\n'
42
51
test.run_gyp('duplicate_basenames.gyp', status=1, stderr=stderr)
43
52
 
 
53
# Check if '--no-duplicate-basename-check' works.
 
54
if ((test.format == 'make' and sys.platform == 'darwin') or
 
55
    (test.format == 'msvs' and
 
56
        int(os.environ.get('GYP_MSVS_VERSION', 2010)) < 2010)):
 
57
  stderr = 'gyp: Duplicate basenames in sources section, see list above\n'
 
58
  test.run_gyp('duplicate_basenames.gyp', '--no-duplicate-basename-check',
 
59
               status=1, stderr=stderr)
 
60
else:
 
61
  test.run_gyp('duplicate_basenames.gyp', '--no-duplicate-basename-check')
 
62
 
44
63
stderr = ("gyp: Dependency '.*missing_dep.gyp:missing.gyp#target' not found "
45
64
          "while trying to load target .*missing_dep.gyp:foo#target\n")
46
65
test.run_gyp('missing_dep.gyp', status=1, stderr=stderr,
47
66
             match=TestCmd.match_re)
48
67
 
 
68
# Make sure invalid <!() command invocations say what command it was and
 
69
# mention the gyp file name. Use a "random" command name to trigger an ENOENT.
 
70
stderr = (".*invalid-command-name-egtyevNif3.*netDurj9.*missing_command.gyp.*")
 
71
test.run_gyp('missing_command.gyp', status=1, stderr=stderr,
 
72
             match=TestCmd.match_re_dotall)
 
73
 
 
74
# Make sure <!() commands that error out result in a message that mentions
 
75
# the command and gyp file name
 
76
stderr = (".*python.*-c.*import sys.*sys.exit.*3.*error_command.gyp.*")
 
77
test.run_gyp('error_command.gyp', status=1, stderr=stderr,
 
78
             match=TestCmd.match_re_dotall)
 
79
 
49
80
test.pass_test()