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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2009 Google Inc. All rights reserved. 3 # Copyright (c) 2009 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """ 7 """
8 Verifies building a subsidiary dependent target from a .gyp file in a 8 Verifies building a subsidiary dependent target from a .gyp file in a
9 subdirectory, without specifying an explicit output build directory, 9 subdirectory, without specifying an explicit output build directory,
10 and using the subdirectory's solution or project file as the entry point. 10 and using the subdirectory's solution or project file as the entry point.
11 """ 11 """
12 12
13 import TestGyp 13 import TestGyp
14 import errno
14 15
15 test = TestGyp.TestGyp() 16 test = TestGyp.TestGyp()
16 17
17 test.run_gyp('prog1.gyp', chdir='src') 18 test.run_gyp('prog1.gyp', chdir='src')
18 19
19 test.relocate('src', 'relocate/src') 20 test.relocate('src', 'relocate/src')
20 21
21 test.build('prog2.gyp', chdir='relocate/src/subdir') 22 chdir = 'relocate/src/subdir'
22 23
23 test.must_not_exist('relocate/src/prog1'+test._exe) 24 # Make can build sub-projects, but it's still through the top-level Makefile,
25 # and there is no 'default' or 'all' sub-project, so the target must be
26 # explicit.
27 # TODO(mmoss) Should make create self-contained, sub-project Makefiles,
28 # equilvalent to the sub-project .sln/SConstruct/etc. files of other generators?
29 if test.format == 'make':
30 chdir = 'relocate/src'
31 test.build('prog2.gyp', 'prog2', chdir=chdir)
32 else:
33 test.build('prog2.gyp', chdir=chdir)
34
35 # 'prog1' shouldn't have been built, so it should throw a 'No such file or
36 # directory' exception. If it does exist, running it should fail the stdout
37 # match. This is clunky, but it's arguably less fragile than looking for the
38 # different platform/generator-dependent paths.
39 try:
40 test.run_built_executable('prog1',
41 chdir=chdir,
42 stdout="")
43 except OSError, e:
44 if e.errno != errno.ENOENT:
45 raise e
24 46
25 test.run_built_executable('prog2', 47 test.run_built_executable('prog2',
26 chdir='relocate/src/subdir', 48 chdir=chdir,
27 stdout="Hello from prog2.c\n") 49 stdout="Hello from prog2.c\n")
28 50
29 test.pass_test() 51 test.pass_test()
OLDNEW
« 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