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

Side by Side Diff: tools/isolate/run_test_cases_test.py

Issue 10825049: run_test_cases.py: Enable use of RUN_TEST_CASES_RESULT_FILE as environment variable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months 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 | « tools/isolate/run_test_cases.py ('k') | 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 # 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 import logging 6 import logging
7 import os 7 import os
8 import sys 8 import sys
9 import unittest 9 import unittest
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 def test_call_timeout_no_kill_eol(self): 92 def test_call_timeout_no_kill_eol(self):
93 cmd = [sys.executable, SLEEP, '0.001'] 93 cmd = [sys.executable, SLEEP, '0.001']
94 output, code = run_test_cases.call_with_timeout( 94 output, code = run_test_cases.call_with_timeout(
95 cmd, timeout=100, universal_newlines=True) 95 cmd, timeout=100, universal_newlines=True)
96 self.assertEquals('Sleeping.\nSlept.\n', output) 96 self.assertEquals('Sleeping.\nSlept.\n', output)
97 self.assertEquals(0, code) 97 self.assertEquals(0, code)
98 98
99 def test_gtest_filter(self): 99 def test_gtest_filter(self):
100 old = run_test_cases.run_test_cases 100 old = run_test_cases.run_test_cases
101 exe = os.path.join(ROOT_DIR, 'data', 'gtest_fake', 'gtest_fake_pass.py') 101 exe = os.path.join(ROOT_DIR, 'data', 'gtest_fake', 'gtest_fake_pass.py')
102 def expect(executable, test_cases, jobs, timeout, no_dump): 102 def expect(executable, test_cases, jobs, timeout, result_file):
103 self.assertEquals(exe, executable) 103 self.assertEquals(exe, executable)
104 self.assertEquals(['Foo.Bar1', 'Foo.Bar3'], test_cases) 104 self.assertEquals(['Foo.Bar1', 'Foo.Bar3'], test_cases)
105 self.assertEquals(run_test_cases.num_processors(), jobs) 105 self.assertEquals(run_test_cases.num_processors(), jobs)
106 self.assertEquals(120, timeout) 106 self.assertEquals(120, timeout)
107 self.assertEquals(None, no_dump) 107 self.assertEquals(exe + '.run_test_cases', result_file)
108 return 89 108 return 89
109 try: 109 try:
110 run_test_cases.run_test_cases = expect 110 run_test_cases.run_test_cases = expect
111 result = run_test_cases.main([exe, '--gtest_filter=Foo.Bar*-*.Bar2']) 111 result = run_test_cases.main([exe, '--gtest_filter=Foo.Bar*-*.Bar2'])
112 self.assertEquals(89, result) 112 self.assertEquals(89, result)
113 finally: 113 finally:
114 run_test_cases.run_test_cases = old 114 run_test_cases.run_test_cases = old
115 115
116 116
117 class WorkerPoolTest(unittest.TestCase): 117 class WorkerPoolTest(unittest.TestCase):
(...skipping 18 matching lines...) Expand all
136 pool.join() 136 pool.join()
137 self.fail() 137 self.fail()
138 except FearsomeException: 138 except FearsomeException:
139 self.assertEquals(True, task_added) 139 self.assertEquals(True, task_added)
140 140
141 141
142 if __name__ == '__main__': 142 if __name__ == '__main__':
143 VERBOSE = '-v' in sys.argv 143 VERBOSE = '-v' in sys.argv
144 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) 144 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR)
145 unittest.main() 145 unittest.main()
OLDNEW
« no previous file with comments | « tools/isolate/run_test_cases.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698