gyptest-link-tsaware.py 849 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 tsaware 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('tsaware.gyp', chdir=CHDIR)
  14. test.build('tsaware.gyp', test.ALL, chdir=CHDIR)
  15. def GetHeaders(exe):
  16. return test.run_dumpbin('/headers', test.built_file_path(exe, chdir=CHDIR))
  17. # Explicitly off, should not be marked NX compatiable.
  18. if 'Terminal Server Aware' in GetHeaders('test_tsaware_no.exe'):
  19. test.fail_test()
  20. # Explicitly on.
  21. if 'Terminal Server Aware' not in GetHeaders('test_tsaware_yes.exe'):
  22. test.fail_test()
  23. test.pass_test()