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

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

Issue 9704083: Use dart:io directory deletion instead of starting a process. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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) 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 /** 5 /**
6 * Classes and methods for executing tests. 6 * Classes and methods for executing tests.
7 * 7 *
8 * This module includes: 8 * This module includes:
9 * - Managing parallel execution of tests, including timeout checks. 9 * - Managing parallel execution of tests, including timeout checks.
10 * - Evaluating the output of each test as pass/fail/crash/timeout. 10 * - Evaluating the output of each test as pass/fail/crash/timeout.
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 if (_tests.isEmpty() && _numProcesses == 0) { 902 if (_tests.isEmpty() && _numProcesses == 0) {
903 _terminateBatchRunners(); 903 _terminateBatchRunners();
904 if (_keepGeneratedTests || _temporaryDirectory == null) { 904 if (_keepGeneratedTests || _temporaryDirectory == null) {
905 _cleanupAndMarkDone(); 905 _cleanupAndMarkDone();
906 } else if (!_temporaryDirectory.startsWith('/tmp/') || 906 } else if (!_temporaryDirectory.startsWith('/tmp/') ||
907 _temporaryDirectory.contains('/../')) { 907 _temporaryDirectory.contains('/../')) {
908 // Let's be extra careful, since rm -rf is so dangerous. 908 // Let's be extra careful, since rm -rf is so dangerous.
909 print('Temporary directory $_temporaryDirectory unsafe to delete!'); 909 print('Temporary directory $_temporaryDirectory unsafe to delete!');
910 _cleanupAndMarkDone(); 910 _cleanupAndMarkDone();
911 } else { 911 } else {
912 // TODO(dart:1211): Use delete(recursive=true) in Dart when it is 912 Directory dir = new Directory(_temporaryDirectory);
913 // implemented, and add Windows support. 913 dir.deleteRecursively(() {
914 var deletion =
915 new Process.start('/bin/rm', ['-rf', _temporaryDirectory]);
916 deletion.onExit = (int exitCode) {
917 if (exitCode == 0) {
918 if (!_listTests) { // Output of --list option is used by scripts.
919 print('\nTemporary directory $_temporaryDirectory deleted.');
920 }
921 } else {
922 print('\nDeletion of temp dir $_temporaryDirectory failed.');
923 }
924 _cleanupAndMarkDone(); 914 _cleanupAndMarkDone();
915 });
916 dir.onError = (err) {
917 print('\nDeletion of temp dir $_temporaryDirectory failed: $err');
925 }; 918 };
926 } 919 }
927 } 920 }
928 } 921 }
929 } 922 }
930 923
931 /** 924 /**
932 * True if we are using a browser + platform combination that needs the 925 * True if we are using a browser + platform combination that needs the
933 * Selenium server jar. 926 * Selenium server jar.
934 */ 927 */
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 // the developer doesn't waste his or her time trying to fix a bunch of 1104 // the developer doesn't waste his or her time trying to fix a bunch of
1112 // tests that appear to be broken but were actually just flakes that 1105 // tests that appear to be broken but were actually just flakes that
1113 // didn't get retried because there had already been one failure. 1106 // didn't get retried because there had already been one failure.
1114 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests; 1107 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests;
1115 new RunningProcess(test, allowRetry, this).start(); 1108 new RunningProcess(test, allowRetry, this).start();
1116 } 1109 }
1117 _numProcesses++; 1110 _numProcesses++;
1118 } 1111 }
1119 } 1112 }
1120 } 1113 }
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