Chromium Code Reviews| Index: test/subdirectory/gyptest-subdir-all.py |
| =================================================================== |
| --- test/subdirectory/gyptest-subdir-all.py (revision 726) |
| +++ test/subdirectory/gyptest-subdir-all.py (working copy) |
| @@ -11,6 +11,7 @@ |
| """ |
| import TestGyp |
| +import errno |
| test = TestGyp.TestGyp() |
| @@ -18,12 +19,34 @@ |
| test.relocate('src', 'relocate/src') |
| -test.build('prog2.gyp', test.ALL, chdir='relocate/src/subdir') |
| +chdir = 'relocate/src/subdir' |
| +target = test.ALL |
| -test.must_not_exist('relocate/src/prog1'+test._exe) |
| +# Make can build sub-projects, but it's still through the top-level Makefile, |
| +# and there is no 'default' or 'all' sub-project, so the target must be |
| +# explicit. |
| +# TODO(mmoss) Should make create self-contained, sub-project Makefiles, |
|
Evan Martin
2009/10/27 19:25:39
s/Should/Should we/
?
Here and in the other file
Michael Moss
2009/10/27 19:38:10
Actually, that's meant to read "Should (the) make
|
| +# equilvalent to the sub-project .sln/SConstruct/etc. files of other generators? |
| +if test.format == 'make': |
| + chdir = 'relocate/src' |
| + target = 'prog2' |
| +test.build('prog2.gyp', target, chdir=chdir) |
| + |
| +# 'prog1' shouldn't have been built, so it should throw a 'No such file or |
| +# directory' exception. If it does exist, running it should fail the stdout |
| +# match. This is clunky, but it's arguably less fragile than looking for the |
| +# different platform/generator-dependent paths. |
| +try: |
| + test.run_built_executable('prog1', |
| + chdir=chdir, |
| + stdout="") |
| +except OSError, e: |
| + if e.errno != errno.ENOENT: |
| + raise e |
| + |
| test.run_built_executable('prog2', |
| - chdir='relocate/src/subdir', |
| + chdir=chdir, |
| stdout="Hello from prog2.c\n") |
| test.pass_test() |