gyptest-cl-exception-handling.py 886 B

123456789101112131415161718192021222324252627282930313233
  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 exception handling settings are 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('exception-handling.gyp', chdir=CHDIR)
  14. # Must fail.
  15. test.build('exception-handling.gyp', 'test_eh_off', chdir=CHDIR,
  16. status=1)
  17. # Must succeed.
  18. test.build('exception-handling.gyp', 'test_eh_s', chdir=CHDIR)
  19. test.build('exception-handling.gyp', 'test_eh_a', chdir=CHDIR)
  20. # Error code must be 1 if EHa, and 2 if EHsc.
  21. test.run_built_executable('test_eh_a', chdir=CHDIR, status=1)
  22. test.run_built_executable('test_eh_s', chdir=CHDIR, status=2)
  23. test.pass_test()