Chromium Code Reviews| Index: test/msvs/shared_output/gyptest-shared_output.py |
| =================================================================== |
| --- test/msvs/shared_output/gyptest-shared_output.py (revision 0) |
| +++ test/msvs/shared_output/gyptest-shared_output.py (revision 0) |
| @@ -0,0 +1,50 @@ |
| +#!/usr/bin/env python |
| + |
| +# Copyright (c) 2012 Google Inc. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +""" |
| +Test demonstrating a difference in the expansion precidence between vcbuild |
|
scottmg
2012/05/08 20:25:14
typo, precedence
|
| +and msbuild. |
| +Previously $(OutDir) when used in the definition of IntermediateDirectory |
| +would expand to the value of OutputDirectory in the project scrope. |
|
scottmg
2012/05/08 20:25:14
typo, scope
|
| +With msbuild, $(OutDir) expands based on the inherited property value, |
| +which defaults to $(SolutionDir)/$(Configuration). |
| +To work with all versions of msvs, we should avoid defining |
| +IntermediateDirectory in terms of $(OutDir). |
| +""" |
| + |
| +import TestGyp |
| +import os |
| + |
| +test = TestGyp.TestGyp(workdir='workarea_shared_output', formats=['msvs']) |
| + |
| +test.run_gyp('hello.gyp') |
| +test.set_configuration('Baz') |
| + |
| +test.build('there/there.gyp', test.ALL) |
| +test.must_exist(os.path.join(test.workdir, 'foo', 'there.exe')) |
| + |
| +# MSBuild expands $(OutDir) based on inherited values, so it cannot be |
| +# sensibly used in the definition of IntermediateDirectory. |
| +if test.uses_msbuild: |
| + test.must_exist(os.path.join(test.workdir, |
| + 'there', 'Baz', 'bar', 'there.obj')) |
| +else: |
| + test.must_exist(os.path.join(test.workdir, |
| + 'foo', 'bar', 'there.obj')) |
| + |
| +test.build('hello.gyp', test.ALL) |
| +test.must_exist(os.path.join(test.workdir, 'foo', 'hello.exe')) |
| + |
| +# MSBuild expands $(OutDir) based on inherited values, so it cannot be |
| +# sensibly used in the definition of IntermediateDirectory. |
|
scottmg
2012/05/08 20:25:14
probably don't need this same comment 2x
|
| +if test.uses_msbuild: |
| + test.must_exist(os.path.join(test.workdir, |
| + 'Baz', 'bar', 'hello.obj')) |
| +else: |
| + test.must_exist(os.path.join(test.workdir, |
| + 'foo', 'bar', 'hello.obj')) |
| + |
| +test.pass_test() |
| Property changes on: test/msvs/shared_output/gyptest-shared_output.py |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |