1#!/usr/bin/env python
2
3# Copyright (c) 2012 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"""
8Verifies that the 'ProgramDatabaseFile' attribute in VCLinker is extracted
9properly.
10"""
11
12import TestGyp
13
14import os
15import sys
16
17
18if sys.platform == 'win32':
19  test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
20  CHDIR = 'linker-flags'
21  test.run_gyp('program-database.gyp', chdir=CHDIR)
22  test.build('program-database.gyp', test.ALL, 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  # Verify the specified PDB is created when ProgramDatabaseFile
29  # is provided.
30  if not FindFile('name_outdir.pdb'):
31    test.fail_test()
32  if not FindFile('name_proddir.pdb'):
33    test.fail_test()
34
35  test.pass_test()
36