OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 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 simple actions when using an explicit build target of 'all'. | 8 Verifies simple actions when using an explicit build target of 'all'. |
9 """ | 9 """ |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 expect = """\ | 46 expect = """\ |
47 Hello from program.c | 47 Hello from program.c |
48 Hello from make-prog1.py | 48 Hello from make-prog1.py |
49 Hello from make-prog2.py | 49 Hello from make-prog2.py |
50 """ | 50 """ |
51 | 51 |
52 if test.format == 'xcode': | 52 if test.format == 'xcode': |
53 chdir = 'relocate/src/subdir1' | 53 chdir = 'relocate/src/subdir1' |
54 else: | 54 else: |
55 chdir = 'relocate/src' | 55 chdir = 'relocate/src' |
56 test.run_built_executable('program', chdir=chdir, stdout=expect) | 56 |
57 if test.format == 'android': | |
58 test.run_built_executable('program', chdir=chdir, stdout=expect, | |
59 subdir='subdir1') | |
Torne
2014/06/11 12:44:18
Why do we need to add subdirs here? Perhaps we can
jbudorick
2014/06/11 16:30:22
I'm not sure if we can change how the generator de
Torne
2014/06/11 16:41:39
I don't understand what the subdir parameter here
| |
60 else: | |
61 test.run_built_executable('program', chdir=chdir, stdout=expect) | |
57 | 62 |
58 | 63 |
59 test.must_match('relocate/src/subdir2/file.out', "Hello from make-file.py\n") | 64 test.must_match('relocate/src/subdir2/file.out', "Hello from make-file.py\n") |
60 | 65 |
61 | 66 |
62 expect = "Hello from generate_main.py\n" | 67 expect = "Hello from generate_main.py\n" |
63 | 68 |
64 if test.format == 'xcode': | 69 if test.format == 'xcode': |
65 chdir = 'relocate/src/subdir3' | 70 chdir = 'relocate/src/subdir3' |
66 else: | 71 else: |
67 chdir = 'relocate/src' | 72 chdir = 'relocate/src' |
68 test.run_built_executable('null_input', chdir=chdir, stdout=expect) | 73 |
74 if test.format == 'android': | |
75 test.run_built_executable('null_input', chdir=chdir, stdout=expect, | |
76 subdir='subdir3') | |
77 else: | |
78 test.run_built_executable('null_input', chdir=chdir, stdout=expect) | |
69 | 79 |
70 | 80 |
71 # Clean out files which may have been created if test.ALL was run. | 81 # Clean out files which may have been created if test.ALL was run. |
72 def clean_dep_files(): | 82 def clean_dep_files(): |
73 for file in (glob.glob('relocate/src/dep_*.txt') + | 83 for file in (glob.glob('relocate/src/dep_*.txt') + |
74 glob.glob('relocate/src/deps_all_done_*.txt')): | 84 glob.glob('relocate/src/deps_all_done_*.txt')): |
75 if os.path.exists(file): | 85 if os.path.exists(file): |
76 os.remove(file) | 86 os.remove(file) |
77 | 87 |
78 # Confirm our clean. | 88 # Confirm our clean. |
(...skipping 14 matching lines...) Expand all Loading... | |
93 # previous tests deleted. Confirm this execution did NOT run the ALL | 103 # previous tests deleted. Confirm this execution did NOT run the ALL |
94 # target which would mess up our dep tests. | 104 # target which would mess up our dep tests. |
95 clean_dep_files() | 105 clean_dep_files() |
96 test.build('actions.gyp', 'action_with_dependencies_321', chdir='relocate/src', | 106 test.build('actions.gyp', 'action_with_dependencies_321', chdir='relocate/src', |
97 arguments=arguments) | 107 arguments=arguments) |
98 test.must_exist('relocate/src/deps_all_done_first_321.txt') | 108 test.must_exist('relocate/src/deps_all_done_first_321.txt') |
99 test.must_not_exist('relocate/src/deps_all_done_first_123.txt') | 109 test.must_not_exist('relocate/src/deps_all_done_first_123.txt') |
100 | 110 |
101 | 111 |
102 test.pass_test() | 112 test.pass_test() |
OLD | NEW |