gyptest-link-incremental.py 992 B

12345678910111213141516171819202122232425262728293031323334353637
  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 incremental linking 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('incremental.gyp', chdir=CHDIR)
  14. test.build('incremental.gyp', test.ALL, chdir=CHDIR)
  15. def HasILTTables(exe):
  16. full_path = test.built_file_path(exe, chdir=CHDIR)
  17. output = test.run_dumpbin('/disasm', full_path)
  18. return '@ILT+' in output
  19. # Default or unset is to be on.
  20. if not HasILTTables('test_incremental_unset.exe'):
  21. test.fail_test()
  22. if not HasILTTables('test_incremental_default.exe'):
  23. test.fail_test()
  24. if HasILTTables('test_incremental_no.exe'):
  25. test.fail_test()
  26. if not HasILTTables('test_incremental_yes.exe'):
  27. test.fail_test()
  28. test.pass_test()