gyptest-link-pdb-output.py 872 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python
  2. # Copyright (c) 2014 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. Ensure that ninja includes the .pdb as an output file from linking.
  7. """
  8. import TestGyp
  9. import os
  10. import sys
  11. if sys.platform == 'win32':
  12. test = TestGyp.TestGyp(formats=['ninja'])
  13. CHDIR = 'linker-flags'
  14. test.run_gyp('pdb-output.gyp', chdir=CHDIR)
  15. # Note, building the pdbs rather than ALL or gyp target.
  16. test.build('pdb-output.gyp', 'output_exe.pdb', chdir=CHDIR)
  17. test.build('pdb-output.gyp', 'output_dll.pdb', chdir=CHDIR)
  18. def FindFile(pdb):
  19. full_path = test.built_file_path(pdb, chdir=CHDIR)
  20. return os.path.isfile(full_path)
  21. if not FindFile('output_exe.pdb'):
  22. test.fail_test()
  23. if not FindFile('output_dll.pdb'):
  24. test.fail_test()
  25. test.pass_test()