gyptest-link-delay-load-dlls.py 923 B

1234567891011121314151617181920212223242526272829303132333435
  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 delay load 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('delay-load-dlls.gyp', chdir=CHDIR)
  14. test.build('delay-load-dlls.gyp', test.ALL, chdir=CHDIR)
  15. prefix = 'contains the following delay load imports:'
  16. shell32_look_for = prefix + '\r\n\r\n SHELL32.dll'
  17. output = test.run_dumpbin(
  18. '/all', test.built_file_path('test_dld_none.exe', chdir=CHDIR))
  19. if prefix in output:
  20. test.fail_test()
  21. output = test.run_dumpbin(
  22. '/all', test.built_file_path('test_dld_shell32.exe', chdir=CHDIR))
  23. if shell32_look_for not in output:
  24. test.fail_test()
  25. test.pass_test()