OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # Generates a script in the output bin directory which runs the test | 5 # Generates a script in the output bin directory which runs the test |
6 # target using the test runner script in build/android/pylib/test_runner.py. | 6 # target using the test runner script in build/android/pylib/test_runner.py. |
7 # | 7 # |
8 # To use this, include this file in a gtest or instrumentation test target. | 8 # To use this, include this file in a gtest or instrumentation test target. |
9 # { | 9 # { |
10 # 'target_name': 'gtest', | 10 # 'target_name': 'gtest', |
(...skipping 10 matching lines...) Expand all Loading... | |
21 # 'target_name': 'instrumentation_apk', | 21 # 'target_name': 'instrumentation_apk', |
22 # 'type': 'none', | 22 # 'type': 'none', |
23 # 'variables': { | 23 # 'variables': { |
24 # 'test_type': 'instrumentation', # string | 24 # 'test_type': 'instrumentation', # string |
25 # 'apk_name': 'TestApk' # string | 25 # 'apk_name': 'TestApk' # string |
26 # 'isolate_file': 'path/to/instrumentation_test.isolate' # string | 26 # 'isolate_file': 'path/to/instrumentation_test.isolate' # string |
27 # }, | 27 # }, |
28 # 'includes': ['path/to/this/gypi/file'], | 28 # 'includes': ['path/to/this/gypi/file'], |
29 # } | 29 # } |
30 # | 30 # |
31 # { | |
32 # 'target_name': 'junit_test', | |
33 # 'type': 'none', | |
34 # 'variables': { | |
35 # 'test_type': 'junit', # string | |
36 # 'test_suite_name': 'junit_test' # string | |
37 # }, | |
38 # 'includes': ['path/to/this/gypi/file'], | |
39 # } | |
40 # | |
31 | 41 |
32 { | 42 { |
33 'variables': { | 43 'variables': { |
34 'variables': { | 44 'variables': { |
35 'additional_apks%': [], | 45 'additional_apks%': [], |
36 'isolate_file%': '', | 46 'isolate_file%': '', |
37 }, | 47 }, |
38 'test_runner_args': ['--output-directory', '<(PRODUCT_DIR)'], | 48 'test_runner_args': ['--output-directory', '<(PRODUCT_DIR)'], |
39 'conditions': [ | 49 'conditions': [ |
40 ['test_type == "gtest"', { | 50 ['test_type == "gtest"', { |
41 'test_runner_args': ['--suite', '<(test_suite_name)'], | 51 'test_runner_args': ['--suite', '<(test_suite_name)'], |
42 'script_name': 'run_<(test_suite_name)', | 52 'script_name': 'run_<(test_suite_name)', |
43 }], | 53 }], |
44 ['test_type == "instrumentation"', { | 54 ['test_type == "instrumentation"', { |
45 'test_runner_args': [ | 55 'test_runner_args': [ |
46 '--apk-under-test', '>(tested_apk_path)', | 56 '--apk-under-test', '>(tested_apk_path)', |
47 '--test-apk', '>(final_apk_path)', | 57 '--test-apk', '>(final_apk_path)', |
48 ], | 58 ], |
49 'script_name': 'run_<(_target_name)', | 59 'script_name': 'run_<(_target_name)', |
50 'conditions': [ | 60 'conditions': [ |
51 ['emma_instrument != 0', { | 61 ['emma_instrument != 0', { |
52 'test_runner_args': [ | 62 'test_runner_args': [ |
53 '--coverage-dir', '<(PRODUCT_DIR)/coverage', | 63 '--coverage-dir', '<(PRODUCT_DIR)/coverage', |
54 ], | 64 ], |
55 }], | 65 }], |
56 ], | 66 ], |
57 }], | 67 }], |
68 ['test_type == "junit"', { | |
69 'test_runner_args': ['--test-suite', '<(test_suite_name)'], | |
70 'script_name': 'run_<(test_suite_name)', | |
jbudorick
2016/02/09 00:06:47
we should be able to use _target_name instead of t
mikecase (-- gone --)
2016/02/09 00:54:34
Done
| |
71 }], | |
58 ['additional_apks != []', { | 72 ['additional_apks != []', { |
59 'test_runner_args': ['--additional-apk-list', '>(additional_apks)'], | 73 'test_runner_args': ['--additional-apk-list', '>(additional_apks)'], |
60 }], | 74 }], |
61 ['isolate_file != ""', { | 75 ['isolate_file != ""', { |
62 'test_runner_args': ['--isolate-file-path', '<(isolate_file)'] | 76 'test_runner_args': ['--isolate-file-path', '<(isolate_file)'] |
63 }], | 77 }], |
64 ], | 78 ], |
65 }, | 79 }, |
66 'actions': [ | 80 'actions': [ |
67 { | 81 { |
68 'action_name': 'create_test_runner_script_<(script_name)', | 82 'action_name': 'create_test_runner_script_<(script_name)', |
69 'message': 'Creating test runner script <(script_name)', | 83 'message': 'Creating test runner script <(script_name)', |
70 'variables': { | 84 'variables': { |
71 'script_output_path': '<(PRODUCT_DIR)/bin/<(script_name)', | 85 'script_output_path': '<(PRODUCT_DIR)/bin/<(script_name)', |
72 }, | 86 }, |
73 'inputs': [ | 87 'inputs': [ |
74 '<(DEPTH)/build/android/gyp/create_test_runner_script.py', | 88 '<(DEPTH)/build/android/gyp/create_test_runner_script.py', |
75 ], | 89 ], |
76 'outputs': [ | 90 'outputs': [ |
77 '<(script_output_path)' | 91 '<(script_output_path)' |
78 ], | 92 ], |
79 'action': [ | 93 'action': [ |
80 'python', '<(DEPTH)/build/android/gyp/create_test_runner_script.py', | 94 'python', '<(DEPTH)/build/android/gyp/create_test_runner_script.py', |
81 '--script-output-path=<(script_output_path)', | 95 '--script-output-path=<(script_output_path)', |
82 '<(test_type)', '<@(test_runner_args)', | 96 '<(test_type)', '<@(test_runner_args)', |
83 ], | 97 ], |
84 }, | 98 }, |
85 ], | 99 ], |
86 } | 100 } |
OLD | NEW |