gyptest-link-profile.py 941 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. Verifies that the 'Profile' attribute in VCLinker is extracted properly.
  7. """
  8. import TestGyp
  9. import os
  10. import sys
  11. if sys.platform == 'win32':
  12. test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
  13. CHDIR = 'linker-flags'
  14. test.run_gyp('profile.gyp', chdir=CHDIR)
  15. test.build('profile.gyp', test.ALL, chdir=CHDIR)
  16. def GetSummary(exe):
  17. full_path = test.built_file_path(exe, chdir=CHDIR)
  18. return test.run_dumpbin(full_path)
  19. # '.idata' section will be missing when /PROFILE is enabled.
  20. if '.idata' in GetSummary('test_profile_true.exe'):
  21. test.fail_test()
  22. if not '.idata' in GetSummary('test_profile_false.exe'):
  23. test.fail_test()
  24. if not '.idata' in GetSummary('test_profile_default.exe'):
  25. test.fail_test()
  26. test.pass_test()