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

Unified Diff: tools/testing/dart/test_runner.dart

Issue 10398056: Remove system-provided temporary directory usage from test scripts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_runner.dart
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 7c7e78781eb246530aafb34e5b11daa1195d362c..efdab52b718b4879cd53eb7763403f54bce9cca4 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -858,11 +858,9 @@ class ProcessQueue {
int _MAX_FAILED_NO_RETRY = 4;
bool _verbose;
bool _listTests;
- bool _keepGeneratedTests;
Function _enqueueMoreWork;
Queue<TestCase> _tests;
ProgressIndicator _progress;
- String _temporaryDirectory;
// For dartc/selenium batch processing we keep a list of batch processes.
Map<String, List<BatchRunnerProcess>> _batchProcesses;
@@ -896,11 +894,9 @@ class ProcessQueue {
bool printTiming,
Function this._enqueueMoreWork,
[bool verbose = false,
- bool listTests = false,
- bool keepGeneratedTests = false])
+ bool listTests = false])
: _verbose = verbose,
_listTests = listTests,
- _keepGeneratedTests = keepGeneratedTests,
_tests = new Queue<TestCase>(),
_progress = new ProgressIndicator.fromName(progress,
startTime,
@@ -915,8 +911,7 @@ class ProcessQueue {
*/
void addTestSuite(TestSuite testSuite) {
_activeTestListers++;
- testSuite.forEachTest(_runTest, _testCache, globalTemporaryDirectory,
- _testListerDone);
+ testSuite.forEachTest(_runTest, _testCache, _testListerDone);
}
void _testListerDone() {
@@ -924,18 +919,6 @@ class ProcessQueue {
_checkDone();
}
- String globalTemporaryDirectory() {
- if (_temporaryDirectory != null) return _temporaryDirectory;
-
- if (Platform.operatingSystem == 'windows') {
- throw new Exception(
- 'Test suite requires temporary directory. Not supported on Windows.');
- }
- var tempDir = new Directory('').createTempSync();
- _temporaryDirectory = tempDir.path;
- return _temporaryDirectory;
- }
-
/**
* Perform any cleanup needed once all tests in a TestSuite have completed
* and notify our progress indicator that we are done.
@@ -955,22 +938,7 @@ class ProcessQueue {
_progress.allTestsKnown();
if (_tests.isEmpty() && _numProcesses == 0) {
_terminateBatchRunners();
- if (_keepGeneratedTests || _temporaryDirectory == null) {
- _cleanupAndMarkDone();
- } else if (!_temporaryDirectory.startsWith('/tmp/') ||
- _temporaryDirectory.contains('/../')) {
- // Let's be extra careful, since rm -rf is so dangerous.
- print('Temporary directory $_temporaryDirectory unsafe to delete!');
- _cleanupAndMarkDone();
- } else {
- Directory dir = new Directory(_temporaryDirectory);
- dir.deleteRecursively(() {
- _cleanupAndMarkDone();
- });
- dir.onError = (err) {
- print('\nDeletion of temp dir $_temporaryDirectory failed: $err');
- };
- }
+ _cleanupAndMarkDone();
}
}
}
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698