OLD | NEW |
| (Empty) |
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 | |
3 # found in the LICENSE file. | |
4 | |
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. | |
7 # | |
8 # To use this, include this file in a gtest or instrumentation test target. | |
9 # { | |
10 # 'target_name': 'gtest', | |
11 # 'type': 'none', | |
12 # 'variables': { | |
13 # 'test_type': 'gtest', # string | |
14 # 'test_suite_name': 'gtest_suite' # string | |
15 # 'isolate_file': 'path/to/gtest.isolate' # string | |
16 # }, | |
17 # 'includes': ['path/to/this/gypi/file'], | |
18 # } | |
19 # | |
20 # { | |
21 # 'target_name': 'instrumentation_apk', | |
22 # 'type': 'none', | |
23 # 'variables': { | |
24 # 'test_type': 'instrumentation', # string | |
25 # 'apk_name': 'TestApk' # string | |
26 # 'isolate_file': 'path/to/instrumentation_test.isolate' # string | |
27 # }, | |
28 # 'includes': ['path/to/this/gypi/file'], | |
29 # } | |
30 # | |
31 | |
32 { | |
33 'variables': { | |
34 'variables': { | |
35 'isolate_file%': '', | |
36 'support_apk_path%': '', | |
37 }, | |
38 'test_runner_args': ['--output-directory', '<(PRODUCT_DIR)'], | |
39 'conditions': [ | |
40 ['test_type == "gtest"', { | |
41 'test_runner_args': ['--suite', '<(test_suite_name)'], | |
42 'script_name': 'run_<(test_suite_name)', | |
43 }], | |
44 ['test_type == "instrumentation"', { | |
45 'test_runner_args': ['--test-apk', '<(apk_name)'], | |
46 'script_name': 'run_<(_target_name)', | |
47 'conditions': [ | |
48 ['support_apk_path != ""', { | |
49 'test_runner_args': [ | |
50 '--support-apk', | |
51 '<(support_apk_path)' | |
52 ], | |
53 }], | |
54 ], | |
55 }], | |
56 ['isolate_file != ""', { | |
57 'test_runner_args': ['--isolate-file-path', '<(isolate_file)'] | |
58 }], | |
59 ], | |
60 }, | |
61 'actions': [ | |
62 { | |
63 'action_name': 'create_test_runner_script_<(script_name)', | |
64 'message': 'Creating test runner script <(script_name)', | |
65 'variables': { | |
66 'script_output_path': '<(PRODUCT_DIR)/bin/<(script_name)', | |
67 }, | |
68 'inputs': [ | |
69 '<(DEPTH)/build/android/gyp/create_test_runner_script.py', | |
70 ], | |
71 'outputs': [ | |
72 '<(script_output_path)' | |
73 ], | |
74 'action': [ | |
75 'python', '<(DEPTH)/build/android/gyp/create_test_runner_script.py', | |
76 '--script-output-path=<(script_output_path)', | |
77 '<(test_type)', '<@(test_runner_args)', | |
78 ], | |
79 }, | |
80 ], | |
81 } | |
OLD | NEW |