gyptest-link-subsystem.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 subsystem setting is extracted properly.
  7. """
  8. import TestGyp
  9. import sys
  10. if sys.platform == 'win32':
  11. test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
  12. CHDIR = 'linker-flags'
  13. test.run_gyp('subsystem.gyp', chdir=CHDIR)
  14. test.build('subsystem.gyp', 'test_console_ok', chdir=CHDIR)
  15. test.build('subsystem.gyp', 'test_console_fail', chdir=CHDIR, status=1)
  16. test.build('subsystem.gyp', 'test_windows_ok', chdir=CHDIR)
  17. test.build('subsystem.gyp', 'test_windows_fail', chdir=CHDIR, status=1)
  18. test.build('subsystem.gyp', 'test_console_xp', chdir=CHDIR)
  19. test.build('subsystem.gyp', 'test_windows_xp', chdir=CHDIR)
  20. # Make sure we are targeting XP.
  21. def GetHeaders(exe):
  22. return test.run_dumpbin('/headers', test.built_file_path(exe, chdir=CHDIR))
  23. if '5.01 subsystem version' not in GetHeaders('test_console_xp.exe'):
  24. test.fail_test()
  25. if '5.01 subsystem version' not in GetHeaders('test_windows_xp.exe'):
  26. test.fail_test()
  27. # TODO(scottmg): There are other subsystems (WinCE, etc.) that we don't use.
  28. test.pass_test()