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-as-error 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-as-error.gyp', chdir=CHDIR) |
| 20 | |
| 21 | # The source file contains a warning, so if WarnAsError is false (or |
| 22 | # default, which is also false), then the build should succeed, otherwise it |
| 23 | # must fail. |
| 24 | |
| 25 | test.build('warning-as-error.gyp', 'test_warn_as_error_false', chdir=CHDIR) |
| 26 | test.build('warning-as-error.gyp', 'test_warn_as_error_unset', chdir=CHDIR) |
| 27 | test.build('warning-as-error.gyp', 'test_warn_as_error_true', chdir=CHDIR, |
| 28 | status=1) |
| 29 | |
| 30 | test.pass_test() |