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""" 8Test checking that IntermediateDirectory can be defined in terms of 9OutputDirectory. We previously had emitted the definition of 10IntermediateDirectory before the definition of OutputDirectory. 11This is required so that $(IntDir) can be based on $(OutDir). 12""" 13 14import TestGyp 15import os 16 17# NOTE: This test really is vcbuild/msbuild specific (not applicable to windows 18# ninja), as it is testing the msvs output location when opening an .sln 19# other than all.sln. 20test = TestGyp.TestGyp(workdir='workarea_shared_output', formats=['msvs']) 21 22test.run_gyp('hello.gyp') 23test.set_configuration('Baz') 24 25test.build('there/there.gyp', test.ALL) 26test.must_exist(os.path.join(test.workdir, 'foo', 'there.exe')) 27test.must_exist(os.path.join(test.workdir, 'foo', 'bar', 'there.obj')) 28 29test.build('hello.gyp', test.ALL) 30test.must_exist(os.path.join(test.workdir, 'foo', 'hello.exe')) 31test.must_exist(os.path.join(test.workdir, 'foo', 'bar', 'hello.obj')) 32 33if test.format == 'msvs': 34 if test.uses_msbuild: 35 test.must_contain('pull_in_there.vcxproj', 36 '<IntDir>$(OutDir)bar\\</IntDir>') 37 else: 38 test.must_contain('pull_in_there.vcproj', 39 'IntermediateDirectory="$(OutDir)bar\\"') 40 41test.pass_test() 42