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

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

Issue 9195006: Test.dart will wait for the temporary directory to be deleted before exiting. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add a space between the handler parameter list and the opening brace of its body. Created 8 years, 11 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 | « 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 // 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 } else if (!_temporaryDirectory.startsWith('/tmp/') || 472 } else if (!_temporaryDirectory.startsWith('/tmp/') ||
473 _temporaryDirectory.contains('/../')) { 473 _temporaryDirectory.contains('/../')) {
474 // Let's be extra careful, since rm -rf is so dangerous. 474 // Let's be extra careful, since rm -rf is so dangerous.
475 print('Temporary directory $_temporaryDirectory unsafe to delete!'); 475 print('Temporary directory $_temporaryDirectory unsafe to delete!');
476 _progress.allDone(); 476 _progress.allDone();
477 } else { 477 } else {
478 // TODO(dart:1211): Use delete(recursive=true) in Dart when it is 478 // TODO(dart:1211): Use delete(recursive=true) in Dart when it is
479 // implemented, and add Windows support. 479 // implemented, and add Windows support.
480 var deletion = 480 var deletion =
481 new Process.start('/bin/rm', ['-rf', _temporaryDirectory]); 481 new Process.start('/bin/rm', ['-rf', _temporaryDirectory]);
482 deletion.startHandler = (){ 482 deletion.exitHandler = (int exitCode) {
483 if (exitCode == 0) {
484 print('\nTemporary directory $_temporaryDirectory deleted.');
485 } else {
486 print('\nDeletion of temp dir $_temporaryDirectory failed.');
487 }
483 _progress.allDone(); 488 _progress.allDone();
484 }; 489 };
485 } 490 }
486 } 491 }
487 } 492 }
488 } 493 }
489 494
490 void _runTest(TestCase test) { 495 void _runTest(TestCase test) {
491 _progress.testAdded(); 496 _progress.testAdded();
492 _tests.add(test); 497 _tests.add(test);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 test.displayName != 'dartc/junit_tests') { 540 test.displayName != 'dartc/junit_tests') {
536 _ensureDartcBatchRunnersStarted(test.executablePath); 541 _ensureDartcBatchRunnersStarted(test.executablePath);
537 _getDartcBatchRunnerProcess().startTest(test); 542 _getDartcBatchRunnerProcess().startTest(test);
538 } else { 543 } else {
539 new RunningProcess(test).start(); 544 new RunningProcess(test).start();
540 } 545 }
541 _numProcesses++; 546 _numProcesses++;
542 } 547 }
543 } 548 }
544 } 549 }
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