Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame^] | 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 | Make sure warning level is extracted properly. |
| 9 | """ |
| 10 | |
| 11 | import TestGyp |
| 12 | |
| 13 | import sys |
| 14 | |
| 15 | if sys.platform == 'win32': |
| 16 | test = TestGyp.TestGyp(formats=['msvs', 'ninja']) |
| 17 | |
| 18 | CHDIR = 'compiler-flags' |
| 19 | test.run_gyp('warning-level.gyp', chdir=CHDIR) |
| 20 | |
| 21 | # A separate target for each warning level: one pass (compiling a file |
| 22 | # containing a warning that's above the specified level); and one fail |
| 23 | # (compiling a file at the specified level). No pass for 4 of course, |
| 24 | # because it would have to have no warnings. The default warning level is |
| 25 | # equivalent to level 1. |
| 26 | |
| 27 | test.build('warning-level.gyp', 'test_wl1_fail', chdir=CHDIR, status=1) |
| 28 | test.build('warning-level.gyp', 'test_wl1_pass', chdir=CHDIR) |
| 29 | |
| 30 | test.build('warning-level.gyp', 'test_wl2_fail', chdir=CHDIR, status=1) |
| 31 | test.build('warning-level.gyp', 'test_wl2_pass', chdir=CHDIR) |
| 32 | |
| 33 | test.build('warning-level.gyp', 'test_wl3_fail', chdir=CHDIR, status=1) |
| 34 | test.build('warning-level.gyp', 'test_wl3_pass', chdir=CHDIR) |
| 35 | |
| 36 | test.build('warning-level.gyp', 'test_wl4_fail', chdir=CHDIR, status=1) |
| 37 | |
| 38 | test.build('warning-level.gyp', 'test_def_fail', chdir=CHDIR, status=1) |
| 39 | test.build('warning-level.gyp', 'test_def_pass', chdir=CHDIR) |
| 40 | |
| 41 | test.pass_test() |