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 # }, |
| 37 # 'includes': ['path/to/this/gypi/file'], |
| 38 # } |
| 39 # |
31 | 40 |
32 { | 41 { |
33 'variables': { | 42 'variables': { |
34 'variables': { | 43 'variables': { |
35 'additional_apks%': [], | 44 'additional_apks%': [], |
36 'isolate_file%': '', | 45 'isolate_file%': '', |
37 }, | 46 }, |
38 'test_runner_args': ['--output-directory', '<(PRODUCT_DIR)'], | 47 'test_runner_args': ['--output-directory', '<(PRODUCT_DIR)'], |
39 'conditions': [ | 48 'conditions': [ |
40 ['test_type == "gtest"', { | 49 ['test_type == "gtest"', { |
41 'test_runner_args': ['--suite', '<(test_suite_name)'], | 50 'test_runner_args': ['--suite', '<(test_suite_name)'], |
42 'script_name': 'run_<(test_suite_name)', | 51 'script_name': 'run_<(test_suite_name)', |
43 }], | 52 }], |
44 ['test_type == "instrumentation"', { | 53 ['test_type == "instrumentation"', { |
45 'test_runner_args': [ | 54 'test_runner_args': [ |
46 '--apk-under-test', '>(tested_apk_path)', | 55 '--apk-under-test', '>(tested_apk_path)', |
47 '--test-apk', '>(final_apk_path)', | 56 '--test-apk', '>(final_apk_path)', |
48 ], | 57 ], |
49 'script_name': 'run_<(_target_name)', | 58 'script_name': 'run_<(_target_name)', |
50 'conditions': [ | 59 'conditions': [ |
51 ['emma_instrument != 0', { | 60 ['emma_instrument != 0', { |
52 'test_runner_args': [ | 61 'test_runner_args': [ |
53 '--coverage-dir', '<(PRODUCT_DIR)/coverage', | 62 '--coverage-dir', '<(PRODUCT_DIR)/coverage', |
54 ], | 63 ], |
55 }], | 64 }], |
56 ], | 65 ], |
57 }], | 66 }], |
| 67 ['test_type == "junit"', { |
| 68 'test_runner_args': ['--test-suite', '<(_target_name)'], |
| 69 'script_name': 'run_<(_target_name)', |
| 70 }], |
58 ['additional_apks != []', { | 71 ['additional_apks != []', { |
59 'test_runner_args': ['--additional-apk-list', '>(additional_apks)'], | 72 'test_runner_args': ['--additional-apk-list', '>(additional_apks)'], |
60 }], | 73 }], |
61 ['isolate_file != ""', { | 74 ['isolate_file != ""', { |
62 'test_runner_args': ['--isolate-file-path', '<(isolate_file)'] | 75 'test_runner_args': ['--isolate-file-path', '<(isolate_file)'] |
63 }], | 76 }], |
64 ], | 77 ], |
65 }, | 78 }, |
66 'actions': [ | 79 'actions': [ |
67 { | 80 { |
68 'action_name': 'create_test_runner_script_<(script_name)', | 81 'action_name': 'create_test_runner_script_<(script_name)', |
69 'message': 'Creating test runner script <(script_name)', | 82 'message': 'Creating test runner script <(script_name)', |
70 'variables': { | 83 'variables': { |
71 'script_output_path': '<(PRODUCT_DIR)/bin/<(script_name)', | 84 'script_output_path': '<(PRODUCT_DIR)/bin/<(script_name)', |
72 }, | 85 }, |
73 'inputs': [ | 86 'inputs': [ |
74 '<(DEPTH)/build/android/gyp/create_test_runner_script.py', | 87 '<(DEPTH)/build/android/gyp/create_test_runner_script.py', |
75 ], | 88 ], |
76 'outputs': [ | 89 'outputs': [ |
77 '<(script_output_path)' | 90 '<(script_output_path)' |
78 ], | 91 ], |
79 'action': [ | 92 'action': [ |
80 'python', '<(DEPTH)/build/android/gyp/create_test_runner_script.py', | 93 'python', '<(DEPTH)/build/android/gyp/create_test_runner_script.py', |
81 '--script-output-path=<(script_output_path)', | 94 '--script-output-path=<(script_output_path)', |
82 '<(test_type)', '<@(test_runner_args)', | 95 '<(test_type)', '<@(test_runner_args)', |
83 ], | 96 ], |
84 }, | 97 }, |
85 ], | 98 ], |
86 } | 99 } |
OLD | NEW |