| Index: test/subdirectory/gyptest-subdir-default.py
|
| ===================================================================
|
| --- test/subdirectory/gyptest-subdir-default.py (revision 726)
|
| +++ test/subdirectory/gyptest-subdir-default.py (working copy)
|
| @@ -11,6 +11,7 @@
|
| """
|
|
|
| import TestGyp
|
| +import errno
|
|
|
| test = TestGyp.TestGyp()
|
|
|
| @@ -18,12 +19,33 @@
|
|
|
| test.relocate('src', 'relocate/src')
|
|
|
| -test.build('prog2.gyp', chdir='relocate/src/subdir')
|
| +chdir = 'relocate/src/subdir'
|
|
|
| -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,
|
| +# equilvalent to the sub-project .sln/SConstruct/etc. files of other generators?
|
| +if test.format == 'make':
|
| + chdir = 'relocate/src'
|
| + test.build('prog2.gyp', 'prog2', chdir=chdir)
|
| +else:
|
| + test.build('prog2.gyp', 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()
|
|
|