Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: build/android/run_tests.py

Issue 11421187: Raise an exception if a unittest target is missing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: raise an Exception instead Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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)
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 qualified_test_suites = [os.path.join(test_suite_dir, t) 106 qualified_test_suites = [os.path.join(test_suite_dir, t)
107 for t in all_test_suites] 107 for t in all_test_suites]
108 else: 108 else:
109 # out/(Debug|Release)/$SUITE_apk/$SUITE-debug.apk 109 # out/(Debug|Release)/$SUITE_apk/$SUITE-debug.apk
110 qualified_test_suites = [os.path.join(test_suite_dir, 110 qualified_test_suites = [os.path.join(test_suite_dir,
111 t + '_apk', 111 t + '_apk',
112 t + '-debug.apk') 112 t + '-debug.apk')
113 for t in all_test_suites] 113 for t in all_test_suites]
114 for t, q in zip(all_test_suites, qualified_test_suites): 114 for t, q in zip(all_test_suites, qualified_test_suites):
115 if not os.path.exists(q): 115 if not os.path.exists(q):
116 logging.critical('Test suite %s not found in %s.\n' 116 raise Exception('Test suite %s not found in %s.\n'
117 'Supported test suites:\n %s\n' 117 'Supported test suites:\n %s\n'
118 'Ensure it has been built.\n', 118 'Ensure it has been built.\n' %
119 t, q, _TEST_SUITES) 119 (t, q, _TEST_SUITES))
120 return []
121 return qualified_test_suites 120 return qualified_test_suites
122 121
123 122
124 class TimeProfile(object): 123 class TimeProfile(object):
125 """Class for simple profiling of action, with logging of cost.""" 124 """Class for simple profiling of action, with logging of cost."""
126 125
127 def __init__(self, description): 126 def __init__(self, description):
128 self._description = description 127 self._description = description
129 self.Start() 128 self.Start()
130 129
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 # the batch (this happens because the exit status is a sum of all failures 464 # the batch (this happens because the exit status is a sum of all failures
466 # from all suites, but the buildbot associates the exit status only with the 465 # from all suites, but the buildbot associates the exit status only with the
467 # most recent step). 466 # most recent step).
468 if options.exit_code: 467 if options.exit_code:
469 return failed_tests_count 468 return failed_tests_count
470 return 0 469 return 0
471 470
472 471
473 if __name__ == '__main__': 472 if __name__ == '__main__':
474 sys.exit(main(sys.argv)) 473 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698