| OLD | NEW |
| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 411 |
| 412 Future<ScriptCommandOutputImpl> run() { | 412 Future<ScriptCommandOutputImpl> run() { |
| 413 var watch = new Stopwatch()..start(); | 413 var watch = new Stopwatch()..start(); |
| 414 | 414 |
| 415 var source = new io.Directory(_sourceDirectory); | 415 var source = new io.Directory(_sourceDirectory); |
| 416 var destination = new io.Directory(_destinationDirectory); | 416 var destination = new io.Directory(_destinationDirectory); |
| 417 | 417 |
| 418 return destination.exists().then((bool exists) { | 418 return destination.exists().then((bool exists) { |
| 419 var cleanDirectoryFuture; | 419 var cleanDirectoryFuture; |
| 420 if (exists) { | 420 if (exists) { |
| 421 cleanDirectoryFuture = destination.delete(recursive: true); | 421 cleanDirectoryFuture = TestUtils.deleteDirectory(_destinationDirectory); |
| 422 } else { | 422 } else { |
| 423 cleanDirectoryFuture = new Future.value(null); | 423 cleanDirectoryFuture = new Future.value(null); |
| 424 } | 424 } |
| 425 return cleanDirectoryFuture.then((_) { | 425 return cleanDirectoryFuture.then((_) { |
| 426 return TestUtils.copyDirectory(_sourceDirectory, _destinationDirectory); | 426 return TestUtils.copyDirectory(_sourceDirectory, _destinationDirectory); |
| 427 }); | 427 }); |
| 428 }).then((_) { | 428 }).then((_) { |
| 429 return new ScriptCommandOutputImpl( | 429 return new ScriptCommandOutputImpl( |
| 430 this, Expectation.PASS, "", watch.elapsed); | 430 this, Expectation.PASS, "", watch.elapsed); |
| 431 }).catchError((error) { | 431 }).catchError((error) { |
| (...skipping 2525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2957 } | 2957 } |
| 2958 } | 2958 } |
| 2959 | 2959 |
| 2960 void eventAllTestsDone() { | 2960 void eventAllTestsDone() { |
| 2961 for (var listener in _eventListener) { | 2961 for (var listener in _eventListener) { |
| 2962 listener.allDone(); | 2962 listener.allDone(); |
| 2963 } | 2963 } |
| 2964 _allDone(); | 2964 _allDone(); |
| 2965 } | 2965 } |
| 2966 } | 2966 } |
| OLD | NEW |