|
OLD | NEW |
---|---|
(Empty) | |
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 """ | |
8 Test demonstrating a difference in the expansion precidence between vcbuild | |
scottmg
2012/05/08 20:25:14
typo, precedence
| |
9 and msbuild. | |
10 Previously $(OutDir) when used in the definition of IntermediateDirectory | |
11 would expand to the value of OutputDirectory in the project scrope. | |
scottmg
2012/05/08 20:25:14
typo, scope
| |
12 With msbuild, $(OutDir) expands based on the inherited property value, | |
13 which defaults to $(SolutionDir)/$(Configuration). | |
14 To work with all versions of msvs, we should avoid defining | |
15 IntermediateDirectory in terms of $(OutDir). | |
16 """ | |
17 | |
18 import TestGyp | |
19 import os | |
20 | |
21 test = TestGyp.TestGyp(workdir='workarea_shared_output', formats=['msvs']) | |
22 | |
23 test.run_gyp('hello.gyp') | |
24 test.set_configuration('Baz') | |
25 | |
26 test.build('there/there.gyp', test.ALL) | |
27 test.must_exist(os.path.join(test.workdir, 'foo', 'there.exe')) | |
28 | |
29 # MSBuild expands $(OutDir) based on inherited values, so it cannot be | |
30 # sensibly used in the definition of IntermediateDirectory. | |
31 if test.uses_msbuild: | |
32 test.must_exist(os.path.join(test.workdir, | |
33 'there', 'Baz', 'bar', 'there.obj')) | |
34 else: | |
35 test.must_exist(os.path.join(test.workdir, | |
36 'foo', 'bar', 'there.obj')) | |
37 | |
38 test.build('hello.gyp', test.ALL) | |
39 test.must_exist(os.path.join(test.workdir, 'foo', 'hello.exe')) | |
40 | |
41 # MSBuild expands $(OutDir) based on inherited values, so it cannot be | |
42 # sensibly used in the definition of IntermediateDirectory. | |
scottmg
2012/05/08 20:25:14
probably don't need this same comment 2x
| |
43 if test.uses_msbuild: | |
44 test.must_exist(os.path.join(test.workdir, | |
45 'Baz', 'bar', 'hello.obj')) | |
46 else: | |
47 test.must_exist(os.path.join(test.workdir, | |
48 'foo', 'bar', 'hello.obj')) | |
49 | |
50 test.pass_test() | |
OLD | NEW |