Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | # Copyright (c) 2014 Google Inc. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | """ |
| 8 | Ensure that ninja includes the .pdb as an output file from linking. |
| 9 | """ |
| 10 | |
| 11 | import TestGyp |
| 12 | |
| 13 | import os |
| 14 | import sys |
| 15 | |
| 16 | if sys.platform == 'win32': |
| 17 | test = TestGyp.TestGyp(formats=['ninja']) |
| 18 | CHDIR = 'linker-flags' |
| 19 | test.run_gyp('pdb-output.gyp', chdir=CHDIR) |
| 20 | # Note, building the pdbs rather than ALL or gyp target. |
| 21 | test.build('pdb-output.gyp', 'output_exe.pdb', chdir=CHDIR) |
| 22 | test.build('pdb-output.gyp', 'output_dll.pdb', chdir=CHDIR) |
| 23 | |
| 24 | def FindFile(pdb): |
| 25 | full_path = test.built_file_path(pdb, chdir=CHDIR) |
| 26 | return os.path.isfile(full_path) |
| 27 | |
| 28 | if not FindFile('output_exe.pdb'): |
| 29 | test.fail_test() |
| 30 | if not FindFile('output_dll.pdb'): |
| 31 | test.fail_test() |
| 32 | |
| 33 | test.pass_test() |