OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 Google Inc. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Verifies that xcode-style GCC_... settings are handled properly. | 8 Verifies that xcode-style GCC_... settings are handled properly. |
9 """ | 9 """ |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 # List of targets that'll pass. It expects targets of the same name with | 25 # List of targets that'll pass. It expects targets of the same name with |
26 # '-fail' appended that'll fail to build. | 26 # '-fail' appended that'll fail to build. |
27 targets = [ | 27 targets = [ |
28 'warn_about_missing_newline', | 28 'warn_about_missing_newline', |
29 ] | 29 ] |
30 | 30 |
31 # clang doesn't warn on invalid offsetofs, it silently ignores | 31 # clang doesn't warn on invalid offsetofs, it silently ignores |
32 # -Wno-invalid-offsetof. | 32 # -Wno-invalid-offsetof. |
33 # TODO(thakis): This isn't really the right way to detect the compiler, | 33 # TODO(thakis): This isn't really the right way to detect the compiler, |
34 # `which cc` detects what make ends up using, and Xcode has some embedded | 34 # Xcode has some embedded compiler, but it's a reliable proxy at least on |
35 # compiler, but it's a reliable proxy at least on the bots. | 35 # the bots. The compiler is forced to gcc/g++ in the gyp file in a |
36 if os.readlink('/usr/bin/cc') != 'clang': | 36 # make_global_settings section for ninja and make. |
| 37 if test.format != 'xcode' or os.readlink('/usr/bin/cc') != 'clang': |
37 targets.append('warn_about_invalid_offsetof_macro') | 38 targets.append('warn_about_invalid_offsetof_macro') |
38 | 39 |
39 for target in targets: | 40 for target in targets: |
40 test.build('test.gyp', target, chdir=CHDIR) | 41 test.build('test.gyp', target, chdir=CHDIR) |
41 test.built_file_must_exist(target, chdir=CHDIR) | 42 test.built_file_must_exist(target, chdir=CHDIR) |
42 fail_target = target + '-fail' | 43 fail_target = target + '-fail' |
43 test.build('test.gyp', fail_target, chdir=CHDIR, status=None, | 44 test.build('test.gyp', fail_target, chdir=CHDIR, status=None, |
44 stderr=None, match=IgnoreOutput) | 45 stderr=None, match=IgnoreOutput) |
45 test.built_file_must_not_exist(fail_target, chdir=CHDIR) | 46 test.built_file_must_not_exist(fail_target, chdir=CHDIR) |
46 | 47 |
47 test.pass_test() | 48 test.pass_test() |
OLD | NEW |