Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2011 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 two actions can be attached to the same input files. | 8 Verifies two actions can be attached to the same input files. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import sys | |
| 12 | |
| 11 import TestGyp | 13 import TestGyp |
| 12 | 14 |
| 13 test = TestGyp.TestGyp() | 15 test = TestGyp.TestGyp() |
| 14 | 16 |
| 15 test.run_gyp('actions.gyp', chdir='src') | 17 test.run_gyp('actions.gyp', chdir='src') |
| 16 | 18 |
| 17 test.relocate('src', 'relocate/src') | 19 test.relocate('src', 'relocate/src') |
| 18 | 20 |
| 21 # Test that multiple actions in a 'none' target that | |
| 22 # depend on another 'none' target cause depended on target to | |
|
Nico
2012/05/29 21:33:08
this doesn't parse for me
bradn
2012/05/29 21:44:26
Done.
| |
| 23 # run individually. | |
| 24 # This sub-test can only be done with generators/build tools that can | |
| 25 # be asked to build individual files rather than whole targets (make, ninja). | |
| 26 if test.format in ['make', 'ninja']: | |
| 27 # Select location of target based on generator. | |
| 28 if test.format == 'make': | |
| 29 target='multi2.txt' | |
|
Nico
2012/05/29 21:33:08
spaces around =
bradn
2012/05/29 21:44:26
Done.
| |
| 30 elif test.format == 'ninja': | |
| 31 if sys.platform in ['win32', 'cygwin']: | |
| 32 target='..\\..\\multi2.txt' | |
| 33 else: | |
| 34 target='../../multi2.txt' | |
| 35 else: | |
| 36 assert False | |
| 37 test.build('actions.gyp', chdir='relocate/src', target=target) | |
| 38 test.must_contain('relocate/src/multi2.txt', 'hello there') | |
| 39 test.must_contain('relocate/src/multi_dep.txt', 'hello there') | |
| 40 | |
| 41 | |
| 19 # Test that two actions can be attached to the same inputs. | 42 # Test that two actions can be attached to the same inputs. |
| 20 test.build('actions.gyp', test.ALL, chdir='relocate/src') | 43 test.build('actions.gyp', test.ALL, chdir='relocate/src') |
| 21 test.must_contain('relocate/src/output1.txt', 'hello there') | 44 test.must_contain('relocate/src/output1.txt', 'hello there') |
| 22 test.must_contain('relocate/src/output2.txt', 'hello there') | 45 test.must_contain('relocate/src/output2.txt', 'hello there') |
| 23 test.must_contain('relocate/src/output3.txt', 'hello there') | 46 test.must_contain('relocate/src/output3.txt', 'hello there') |
| 24 test.must_contain('relocate/src/output4.txt', 'hello there') | 47 test.must_contain('relocate/src/output4.txt', 'hello there') |
| 25 | 48 |
| 26 # Test that process_outputs_as_sources works in conjuction with merged | 49 # Test that process_outputs_as_sources works in conjuction with merged |
| 27 # actions. | 50 # actions. |
| 28 test.run_built_executable( | 51 test.run_built_executable( |
| 29 'multiple_action_source_filter', | 52 'multiple_action_source_filter', |
| 30 chdir='relocate/src', | 53 chdir='relocate/src', |
| 31 stdout=( | 54 stdout=( |
| 32 '{\n' | 55 '{\n' |
| 33 'bar\n' | 56 'bar\n' |
| 34 'car\n' | 57 'car\n' |
| 35 'dar\n' | 58 'dar\n' |
| 36 'ear\n' | 59 'ear\n' |
| 37 '}\n' | 60 '}\n' |
| 38 ), | 61 ), |
| 39 ) | 62 ) |
| 40 | 63 |
| 41 | 64 |
| 42 test.pass_test() | 65 test.pass_test() |
| OLD | NEW |