gyptest-cl-disable-specific-warnings.py 918 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python
  2. # Copyright (c) 2013 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 disable specific warnings 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('disable-specific-warnings.gyp', chdir=CHDIR)
  14. # The source file contains a warning, so if WarnAsError is true and
  15. # DisableSpecificWarnings for the warning in question is set, then the build
  16. # should succeed, otherwise it must fail.
  17. test.build('disable-specific-warnings.gyp',
  18. 'test_disable_specific_warnings_set',
  19. chdir=CHDIR)
  20. test.build('disable-specific-warnings.gyp',
  21. 'test_disable_specific_warnings_unset',
  22. chdir=CHDIR, status=1)
  23. test.pass_test()