gyptest-link-pdb.py 866 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. Verifies that the 'ProgramDatabaseFile' attribute in VCLinker is extracted
  7. properly.
  8. """
  9. import TestGyp
  10. import os
  11. import sys
  12. if sys.platform == 'win32':
  13. test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
  14. CHDIR = 'linker-flags'
  15. test.run_gyp('program-database.gyp', chdir=CHDIR)
  16. test.build('program-database.gyp', test.ALL, chdir=CHDIR)
  17. def FindFile(pdb):
  18. full_path = test.built_file_path(pdb, chdir=CHDIR)
  19. return os.path.isfile(full_path)
  20. # Verify the specified PDB is created when ProgramDatabaseFile
  21. # is provided.
  22. if not FindFile('name_outdir.pdb'):
  23. test.fail_test()
  24. if not FindFile('name_proddir.pdb'):
  25. test.fail_test()
  26. test.pass_test()