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

Unified Diff: test/subdirectory/gyptest-subdir-all.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
« no previous file with comments | « no previous file | test/subdirectory/gyptest-subdir-default.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « no previous file | test/subdirectory/gyptest-subdir-default.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698