Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Unified Diff: test/subdirectory/gyptest-subdir-default.py

Issue 340008: Update a couple tests for make functionality (working as intended). (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()
« test/subdirectory/gyptest-subdir-all.py ('K') | « test/subdirectory/gyptest-subdir-all.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698