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

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

Issue 9315036: Change output of test.dart --list option, so it can be parsed automatically. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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("dart:io"); 7 #import("dart:io");
8 #import("status_file_parser.dart"); 8 #import("status_file_parser.dart");
9 #import("test_progress.dart"); 9 #import("test_progress.dart");
10 #import("test_suite.dart"); 10 #import("test_suite.dart");
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // Let's be extra careful, since rm -rf is so dangerous. 488 // Let's be extra careful, since rm -rf is so dangerous.
489 print('Temporary directory $_temporaryDirectory unsafe to delete!'); 489 print('Temporary directory $_temporaryDirectory unsafe to delete!');
490 _progress.allDone(); 490 _progress.allDone();
491 } else { 491 } else {
492 // TODO(dart:1211): Use delete(recursive=true) in Dart when it is 492 // TODO(dart:1211): Use delete(recursive=true) in Dart when it is
493 // implemented, and add Windows support. 493 // implemented, and add Windows support.
494 var deletion = 494 var deletion =
495 new Process.start('/bin/rm', ['-rf', _temporaryDirectory]); 495 new Process.start('/bin/rm', ['-rf', _temporaryDirectory]);
496 deletion.exitHandler = (int exitCode) { 496 deletion.exitHandler = (int exitCode) {
497 if (exitCode == 0) { 497 if (exitCode == 0) {
498 print('\nTemporary directory $_temporaryDirectory deleted.'); 498 if (!_listTests) { // Output of --list option is used by scripts.
499 print('\nTemporary directory $_temporaryDirectory deleted.');
500 }
499 } else { 501 } else {
500 print('\nDeletion of temp dir $_temporaryDirectory failed.'); 502 print('\nDeletion of temp dir $_temporaryDirectory failed.');
501 } 503 }
502 _progress.allDone(); 504 _progress.allDone();
503 }; 505 };
504 } 506 }
505 } 507 }
506 } 508 }
507 } 509 }
508 510
(...skipping 22 matching lines...) Expand all
531 } 533 }
532 throw new Exception('Unable to find inactive batch runner.'); 534 throw new Exception('Unable to find inactive batch runner.');
533 } 535 }
534 536
535 void _tryRunTest() { 537 void _tryRunTest() {
536 _checkDone(); 538 _checkDone();
537 if (_numProcesses < _maxProcesses && !_tests.isEmpty()) { 539 if (_numProcesses < _maxProcesses && !_tests.isEmpty()) {
538 TestCase test = _tests.removeFirst(); 540 TestCase test = _tests.removeFirst();
539 if (_verbose) print(test.commandLine); 541 if (_verbose) print(test.commandLine);
540 if (_listTests) { 542 if (_listTests) {
541 print(test.commandLine); 543 final String tab = '\t';
544 String outcomes =
545 Strings.join(new List.from(test.expectedOutcomes), ',');
546 print(test.displayName + tab + outcomes + tab + test.isNegative +
547 tab + Strings.join(test.arguments, tab));
542 return; 548 return;
543 } 549 }
544 _progress.start(test); 550 _progress.start(test);
545 Function oldCallback = test.completedHandler; 551 Function oldCallback = test.completedHandler;
546 Function wrapper = (TestCase test_arg) { 552 Function wrapper = (TestCase test_arg) {
547 _numProcesses--; 553 _numProcesses--;
548 _progress.done(test_arg); 554 _progress.done(test_arg);
549 _tryRunTest(); 555 _tryRunTest();
550 oldCallback(test_arg); 556 oldCallback(test_arg);
551 }; 557 };
552 test.completedHandler = wrapper; 558 test.completedHandler = wrapper;
553 if (test.configuration['component'] == 'dartc' && 559 if (test.configuration['component'] == 'dartc' &&
554 test.displayName != 'dartc/junit_tests') { 560 test.displayName != 'dartc/junit_tests') {
555 _ensureDartcBatchRunnersStarted(test.executablePath); 561 _ensureDartcBatchRunnersStarted(test.executablePath);
556 _getDartcBatchRunnerProcess().startTest(test); 562 _getDartcBatchRunnerProcess().startTest(test);
557 } else { 563 } else {
558 new RunningProcess(test).start(); 564 new RunningProcess(test).start();
559 } 565 }
560 _numProcesses++; 566 _numProcesses++;
561 } 567 }
562 } 568 }
563 } 569 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698