OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Runs all unit tests under this base directory.""" | 6 """Runs all unit tests under this base directory.""" |
7 | 7 |
8 import os | 8 import os |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
11 import unittest | 11 import unittest |
12 | 12 |
13 | 13 |
14 BUILDBOT_PATH = os.path.dirname(os.path.abspath(__file__)) | 14 BUILDBOT_PATH = os.path.dirname(os.path.abspath(__file__)) |
15 | 15 |
16 | 16 |
17 # Add the buildbot directory to the path, in case the tests are being run from | |
18 # elsewhere. | |
19 sys.path.append(os.path.join(BUILDBOT_PATH, 'third_party', 'chromium_buildbot', | |
20 'scripts')) | |
21 | |
22 | |
23 GO_TESTS = [ | 17 GO_TESTS = [ |
24 'perf', | 18 'perf', |
25 ] | 19 ] |
26 | 20 |
27 GO_TEST_FAILED = ( | 21 GO_TEST_FAILED = ( |
28 '''====================================================================== | 22 '''====================================================================== |
29 Go test failed: %s | 23 Go test failed: %s |
30 ---------------------------------------------------------------------- | 24 ---------------------------------------------------------------------- |
31 %s | 25 %s |
32 ---------------------------------------------------------------------- | 26 ---------------------------------------------------------------------- |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if error: | 86 if error: |
93 errors.append(error) | 87 errors.append(error) |
94 | 88 |
95 if errors: | 89 if errors: |
96 for error in errors: | 90 for error in errors: |
97 print error | 91 print error |
98 print 'Failed %d of %d.' % (len(errors), len(tests_to_run) + len(GO_TESTS)) | 92 print 'Failed %d of %d.' % (len(errors), len(tests_to_run) + len(GO_TESTS)) |
99 sys.exit(1) | 93 sys.exit(1) |
100 else: | 94 else: |
101 print 'All tests succeeded.' | 95 print 'All tests succeeded.' |
OLD | NEW |