gyptest-cl-warning-level.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env python
  2. # Copyright (c) 2012 Google Inc. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """
  6. Make sure warning level is extracted properly.
  7. """
  8. import TestGyp
  9. import sys
  10. if sys.platform == 'win32':
  11. test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
  12. CHDIR = 'compiler-flags'
  13. test.run_gyp('warning-level.gyp', chdir=CHDIR)
  14. # A separate target for each warning level: one pass (compiling a file
  15. # containing a warning that's above the specified level); and one fail
  16. # (compiling a file at the specified level). No pass for 4 of course,
  17. # because it would have to have no warnings. The default warning level is
  18. # equivalent to level 1.
  19. test.build('warning-level.gyp', 'test_wl1_fail', chdir=CHDIR, status=1)
  20. test.build('warning-level.gyp', 'test_wl1_pass', chdir=CHDIR)
  21. test.build('warning-level.gyp', 'test_wl2_fail', chdir=CHDIR, status=1)
  22. test.build('warning-level.gyp', 'test_wl2_pass', chdir=CHDIR)
  23. test.build('warning-level.gyp', 'test_wl3_fail', chdir=CHDIR, status=1)
  24. test.build('warning-level.gyp', 'test_wl3_pass', chdir=CHDIR)
  25. test.build('warning-level.gyp', 'test_wl4_fail', chdir=CHDIR, status=1)
  26. test.build('warning-level.gyp', 'test_def_fail', chdir=CHDIR, status=1)
  27. test.build('warning-level.gyp', 'test_def_pass', chdir=CHDIR)
  28. test.pass_test()