gyptest-cl-analysis.py 818 B

123456789101112131415161718192021222324252627282930
  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 PREfast (code analysis) setting is extracted properly.
  7. """
  8. import TestGyp
  9. import os
  10. import sys
  11. if (sys.platform == 'win32' and
  12. int(os.environ.get('GYP_MSVS_VERSION', 0)) >= 2012):
  13. test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
  14. CHDIR = 'compiler-flags'
  15. test.run_gyp('analysis.gyp', chdir=CHDIR)
  16. # Analysis enabled, should fail.
  17. test.build('analysis.gyp', 'test_analysis_on', chdir=CHDIR, status=1)
  18. # Analysis not enabled, or unspecified, should pass.
  19. test.build('analysis.gyp', 'test_analysis_off', chdir=CHDIR)
  20. test.build('analysis.gyp', 'test_analysis_unspec', chdir=CHDIR)
  21. test.pass_test()