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

Side by Side Diff: tools/testing/dart/test_runner.dart

Issue 8992007: Make the repeating argument to timers optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 9 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 | « tests/standalone/src/TimerTest.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("test_runner"); 5 #library("test_runner");
6 6
7 #import("status_file_parser.dart"); 7 #import("status_file_parser.dart");
8 #import("test_progress.dart"); 8 #import("test_progress.dart");
9 #import("test_suite.dart"); 9 #import("test_suite.dart");
10 10
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 startTime = new Date.now(); 229 startTime = new Date.now();
230 process.start(); 230 process.start();
231 InputStream stdoutStream = process.stdout; 231 InputStream stdoutStream = process.stdout;
232 InputStream stderrStream = process.stderr; 232 InputStream stderrStream = process.stderr;
233 StringInputStream stdoutStringStream = new StringInputStream(stdoutStream); 233 StringInputStream stdoutStringStream = new StringInputStream(stdoutStream);
234 StringInputStream stderrStringStream = new StringInputStream(stderrStream); 234 StringInputStream stderrStringStream = new StringInputStream(stderrStream);
235 stdoutStringStream.lineHandler = 235 stdoutStringStream.lineHandler =
236 makeReadHandler(stdoutStringStream, stdout); 236 makeReadHandler(stdoutStringStream, stdout);
237 stderrStringStream.lineHandler = 237 stderrStringStream.lineHandler =
238 makeReadHandler(stderrStringStream, stderr); 238 makeReadHandler(stderrStringStream, stderr);
239 timeoutTimer = new Timer(timeoutHandler, 1000 * testCase.timeout, false); 239 timeoutTimer = new Timer(timeoutHandler, 1000 * testCase.timeout);
240 } 240 }
241 241
242 void timeoutHandler(Timer unusedTimer) { 242 void timeoutHandler(Timer unusedTimer) {
243 timedOut = true; 243 timedOut = true;
244 process.kill(); 244 process.kill();
245 } 245 }
246 } 246 }
247 247
248 248
249 class DartcBatchRunnerProcess { 249 class DartcBatchRunnerProcess {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 }; 287 };
288 _process.kill(); 288 _process.kill();
289 } 289 }
290 290
291 void doStartTest(TestCase testCase) { 291 void doStartTest(TestCase testCase) {
292 _startTime = new Date.now(); 292 _startTime = new Date.now();
293 _testStdout = new List<String>(); 293 _testStdout = new List<String>();
294 _testStderr = new List<String>(); 294 _testStderr = new List<String>();
295 _stdoutStream.lineHandler = _readOutput(_stdoutStream, _testStdout); 295 _stdoutStream.lineHandler = _readOutput(_stdoutStream, _testStdout);
296 _stderrStream.lineHandler = _readOutput(_stderrStream, _testStderr); 296 _stderrStream.lineHandler = _readOutput(_stderrStream, _testStderr);
297 _timer = new Timer(_timeoutHandler(testCase), 297 _timer = new Timer(_timeoutHandler(testCase), testCase.timeout * 1000);
298 testCase.timeout * 1000,
299 false);
300 _process.stdin.write(_createArgumentsLine(testCase.arguments).charCodes()); 298 _process.stdin.write(_createArgumentsLine(testCase.arguments).charCodes());
301 } 299 }
302 300
303 String _createArgumentsLine(List<String> arguments) { 301 String _createArgumentsLine(List<String> arguments) {
304 return Strings.join(arguments, ' ') + '\n'; 302 return Strings.join(arguments, ' ') + '\n';
305 } 303 }
306 304
307 int _reportResult(String output) { 305 int _reportResult(String output) {
308 var test = _currentTest; 306 var test = _currentTest;
309 _currentTest = null; 307 _currentTest = null;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 if (test.configuration['component'] == 'dartc') { 470 if (test.configuration['component'] == 'dartc') {
473 _ensureDartcBatchRunnersStarted(test.executablePath); 471 _ensureDartcBatchRunnersStarted(test.executablePath);
474 _getDartcBatchRunnerProcess().startTest(test); 472 _getDartcBatchRunnerProcess().startTest(test);
475 } else { 473 } else {
476 new RunningProcess(test).start(); 474 new RunningProcess(test).start();
477 } 475 }
478 _numProcesses++; 476 _numProcesses++;
479 } 477 }
480 } 478 }
481 } 479 }
OLDNEW
« no previous file with comments | « tests/standalone/src/TimerTest.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698