blob: 62a5b39b6a28f9f55eee522c63c0bc416e2bfba6 [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001#!/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"""
8Make sure warning level is extracted properly.
9"""
10
11import TestGyp
12
13import sys
14
15if 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()