OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. 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 """Runs all the native unit tests. | 7 """Runs all the native unit tests. |
8 | 8 |
9 1. Copy over test binary to /data/local on device. | 9 1. Copy over test binary to /data/local on device. |
10 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) | 10 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) |
11 to be deployed to the device (in TEST_DATA_DIR). | 11 to be deployed to the device. We use the device's $EXTERNAL_STORAGE as the |
| 12 base dir (which maps to Context.getExternalFilesDir()). |
12 3. Environment: | 13 3. Environment: |
13 3.1. chrome/unit_tests requires (via chrome_paths.cc) a directory named: | 14 3.1. chrome/unit_tests requires (via chrome_paths.cc) a directory named: |
14 TEST_DATA_DIR + /chrome/test/data | 15 $EXTERNAL_STORAGE + /chrome/test/data |
15 3.2. page_cycler_tests have following requirements, | 16 3.2. page_cycler_tests have following requirements, |
16 3.2.1 the following data on host: | 17 3.2.1 the following data on host: |
17 <chrome_src_dir>/tools/page_cycler | 18 <chrome_src_dir>/tools/page_cycler |
18 <chrome_src_dir>/data/page_cycler | 19 <chrome_src_dir>/data/page_cycler |
19 3.2.2. two data directories to store above test data on device named: | 20 3.2.2. two data directories to store above test data on device named: |
20 TEST_DATA_DIR + /tools/ (for database perf test) | 21 $EXTERNAL_STORAGE + /tools/ (for database perf test) |
21 TEST_DATA_DIR + /data/ (for other perf tests) | 22 $EXTERNAL_STORAGE + /data/ (for other perf tests) |
22 3.2.3. a http server to serve http perf tests. | 23 3.2.3. a http server to serve http perf tests. |
23 The http root is host's <chrome_src_dir>/data/page_cycler/, port 8000. | 24 The http root is host's <chrome_src_dir>/data/page_cycler/, port 8000. |
24 3.2.4 a tool named forwarder is also required to run on device to | 25 3.2.4 a tool named forwarder is also required to run on device to |
25 forward the http request/response between host and device. | 26 forward the http request/response between host and device. |
26 3.2.5 Chrome is installed on device. | 27 3.2.5 Chrome is installed on device. |
27 4. Run the binary in the device and stream the log to the host. | 28 4. Run the binary in the device and stream the log to the host. |
28 4.1. Optionally, filter specific tests. | 29 4.1. Optionally, filter specific tests. |
29 4.2. Optionally, rebaseline: run the available tests and update the | 30 4.2. Optionally, rebaseline: run the available tests and update the |
30 suppressions file for failures. | 31 suppressions file for failures. |
31 4.3. If we're running a single test suite and we have multiple devices | 32 4.3. If we're running a single test suite and we have multiple devices |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 # the batch (this happens because the exit status is a sum of all failures | 440 # the batch (this happens because the exit status is a sum of all failures |
440 # from all suites, but the buildbot associates the exit status only with the | 441 # from all suites, but the buildbot associates the exit status only with the |
441 # most recent step). | 442 # most recent step). |
442 if options.exit_code: | 443 if options.exit_code: |
443 return failed_tests_count | 444 return failed_tests_count |
444 return 0 | 445 return 0 |
445 | 446 |
446 | 447 |
447 if __name__ == '__main__': | 448 if __name__ == '__main__': |
448 sys.exit(main(sys.argv)) | 449 sys.exit(main(sys.argv)) |
OLD | NEW |