| Index: tools/testing/dart/test_runner.dart
|
| diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
|
| index 5ddca5d474cacfdb32bdd4a3d1c1e62c12486643..30f52598461eb611daf9e3f169de496a73753d49 100644
|
| --- a/tools/testing/dart/test_runner.dart
|
| +++ b/tools/testing/dart/test_runner.dart
|
| @@ -13,7 +13,6 @@
|
|
|
| #import("dart:io");
|
| #import("dart:isolate");
|
| -#import("dart:uri");
|
| #import("status_file_parser.dart");
|
| #import("test_progress.dart");
|
| #import("test_suite.dart");
|
| @@ -47,62 +46,6 @@ class Command {
|
| }
|
|
|
| String toString() => commandLine;
|
| -
|
| - Future<bool> get outputIsUpToDate => new Future.immediate(false);
|
| -}
|
| -
|
| -class Dart2JsCommand extends Command {
|
| - String _jsOutputFile;
|
| - bool _neverSkipCompilation;
|
| - List<Uri> _bootstrapDependencies;
|
| -
|
| - Dart2JsCommand(this._jsOutputFile,
|
| - this._neverSkipCompilation,
|
| - this._bootstrapDependencies,
|
| - String executable,
|
| - List<String> arguments)
|
| - : super(executable, arguments);
|
| -
|
| - Future<bool> get outputIsUpToDate {
|
| - if (_neverSkipCompilation) return new Future.immediate(false);
|
| -
|
| - Future<List<Uri>> readDepsFile(String path) {
|
| - var file = new File(new Path(path).toNativePath());
|
| - if (!file.existsSync()) {
|
| - return new Future.immediate(null);
|
| - }
|
| - return file.readAsLines().transform((List<String> lines) {
|
| - var dependencies = new List<Uri>();
|
| - for (var line in lines) {
|
| - line = line.trim();
|
| - if (line.length > 0) {
|
| - dependencies.add(new Uri(line));
|
| - }
|
| - }
|
| - return dependencies;
|
| - });
|
| - }
|
| -
|
| - return readDepsFile("$_jsOutputFile.deps").transform((dependencies) {
|
| - if (dependencies != null) {
|
| - dependencies.addAll(_bootstrapDependencies);
|
| - var jsOutputLastModified = TestUtils.lastModifiedCache.getLastModified(
|
| - new Uri.fromComponents(scheme: 'file', path: _jsOutputFile));
|
| - if (jsOutputLastModified != null) {
|
| - for (var dependency in dependencies) {
|
| - var dependencyLastModified =
|
| - TestUtils.lastModifiedCache.getLastModified(dependency);
|
| - if (dependencyLastModified == null ||
|
| - dependencyLastModified > jsOutputLastModified) {
|
| - return false;
|
| - }
|
| - }
|
| - return true;
|
| - }
|
| - }
|
| - return false;
|
| - });
|
| - }
|
| }
|
|
|
| /**
|
| @@ -319,8 +262,7 @@ abstract class CommandOutput {
|
| bool timedOut,
|
| List<String> stdout,
|
| List<String> stderr,
|
| - Duration time,
|
| - bool compilationSkipped) {
|
| + Duration time) {
|
| return new CommandOutputImpl.fromCase(testCase,
|
| command,
|
| exitCode,
|
| @@ -328,8 +270,7 @@ abstract class CommandOutput {
|
| timedOut,
|
| stdout,
|
| stderr,
|
| - time,
|
| - compilationSkipped);
|
| + time);
|
| }
|
|
|
| bool get incomplete;
|
| @@ -355,8 +296,6 @@ abstract class CommandOutput {
|
| List<String> get stderr;
|
|
|
| List<String> get diagnostics;
|
| -
|
| - bool get compilationSkipped;
|
| }
|
|
|
| class CommandOutputImpl implements CommandOutput {
|
| @@ -372,7 +311,6 @@ class CommandOutputImpl implements CommandOutput {
|
| List<String> stderr;
|
| Duration time;
|
| List<String> diagnostics;
|
| - bool compilationSkipped;
|
|
|
| /**
|
| * A flag to indicate we have already printed a warning about ignoring the VM
|
| @@ -395,8 +333,7 @@ class CommandOutputImpl implements CommandOutput {
|
| bool this.timedOut,
|
| List<String> this.stdout,
|
| List<String> this.stderr,
|
| - Duration this.time,
|
| - bool this.compilationSkipped) {
|
| + Duration this.time) {
|
| testCase.commandOutputs[command] = this;
|
| diagnostics = [];
|
| }
|
| @@ -407,8 +344,7 @@ class CommandOutputImpl implements CommandOutput {
|
| bool timedOut,
|
| List<String> stdout,
|
| List<String> stderr,
|
| - Duration time,
|
| - bool compilationSkipped) {
|
| + Duration time) {
|
| if (testCase is BrowserTestCase) {
|
| return new BrowserCommandOutputImpl(testCase,
|
| command,
|
| @@ -417,8 +353,7 @@ class CommandOutputImpl implements CommandOutput {
|
| timedOut,
|
| stdout,
|
| stderr,
|
| - time,
|
| - compilationSkipped);
|
| + time);
|
| } else if (testCase.configuration['compiler'] == 'dartc') {
|
| return new AnalysisCommandOutputImpl(testCase,
|
| command,
|
| @@ -426,8 +361,7 @@ class CommandOutputImpl implements CommandOutput {
|
| timedOut,
|
| stdout,
|
| stderr,
|
| - time,
|
| - compilationSkipped);
|
| + time);
|
| }
|
| return new CommandOutputImpl(testCase,
|
| command,
|
| @@ -436,8 +370,7 @@ class CommandOutputImpl implements CommandOutput {
|
| timedOut,
|
| stdout,
|
| stderr,
|
| - time,
|
| - compilationSkipped);
|
| + time);
|
| }
|
|
|
| String get result =>
|
| @@ -486,8 +419,7 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
|
| timedOut,
|
| stdout,
|
| stderr,
|
| - time,
|
| - compilationSkipped) :
|
| + time) :
|
| super(testCase,
|
| command,
|
| exitCode,
|
| @@ -495,8 +427,7 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
|
| timedOut,
|
| stdout,
|
| stderr,
|
| - time,
|
| - compilationSkipped);
|
| + time);
|
|
|
| bool get didFail {
|
| // Browser case:
|
| @@ -548,24 +479,14 @@ class AnalysisCommandOutputImpl extends CommandOutputImpl {
|
|
|
| bool alreadyComputed = false;
|
| bool failResult;
|
| -
|
| AnalysisCommandOutputImpl(testCase,
|
| command,
|
| exitCode,
|
| timedOut,
|
| stdout,
|
| stderr,
|
| - time,
|
| - compilationSkipped) :
|
| - super(testCase,
|
| - command,
|
| - exitCode,
|
| - false,
|
| - timedOut,
|
| - stdout,
|
| - stderr,
|
| - time,
|
| - compilationSkipped);
|
| + time) :
|
| + super(testCase, command, exitCode, false, timedOut, stdout, stderr, time);
|
|
|
| bool get didFail {
|
| if (!alreadyComputed) {
|
| @@ -733,7 +654,6 @@ class RunningProcess {
|
| Timer timeoutTimer;
|
| List<String> stdout;
|
| List<String> stderr;
|
| - bool compilationSkipped;
|
| bool allowRetries;
|
|
|
| /** Which command of [testCase.commands] is currently being executed. */
|
| @@ -746,9 +666,7 @@ class RunningProcess {
|
| * Called when all commands are executed.
|
| */
|
| void testComplete(CommandOutput lastCommandOutput) {
|
| - if (timeoutTimer != null) {
|
| - timeoutTimer.cancel();
|
| - }
|
| + timeoutTimer.cancel();
|
| if (lastCommandOutput.unexpectedOutput
|
| && testCase.configuration['verbose'] != null
|
| && testCase.configuration['verbose']) {
|
| @@ -810,9 +728,7 @@ class RunningProcess {
|
| // ff, safari, chrome, opera. (It is only null for runtime == vm)
|
| // This RunningProcess object is done, and hands over control to
|
| // BatchRunner.startTest(), which handles reporting, etc.
|
| - if (timeoutTimer != null) {
|
| - timeoutTimer.cancel();
|
| - }
|
| + timeoutTimer.cancel();
|
| processQueue._getBatchRunner(testCase).startTest(testCase);
|
| } else {
|
| runCommand(testCase.commands[currentStep++], commandComplete);
|
| @@ -834,8 +750,7 @@ class RunningProcess {
|
| timedOut,
|
| stdout,
|
| stderr,
|
| - new Date.now().difference(startTime),
|
| - compilationSkipped);
|
| + new Date.now().difference(startTime));
|
| resetLocalOutputInformation();
|
| return commandOutput;
|
| }
|
| @@ -843,7 +758,6 @@ class RunningProcess {
|
| void resetLocalOutputInformation() {
|
| stdout = new List<String>();
|
| stderr = new List<String>();
|
| - compilationSkipped = false;
|
| }
|
|
|
| VoidFunction makeReadHandler(StringInputStream source,
|
| @@ -871,42 +785,31 @@ class RunningProcess {
|
| void processExitHandler(int returnCode) {
|
| commandCompleteHandler(command, returnCode);
|
| }
|
| -
|
| - command.outputIsUpToDate.then((bool isUpToDate) {
|
| - if (isUpToDate) {
|
| - stdout.add("Skipped compilation because the old output is "
|
| - "still up to date!");
|
| - compilationSkipped = true;
|
| - commandComplete(command, 0);
|
| - } else {
|
| - Future processFuture = Process.start(command.executable,
|
| - command.arguments);
|
| - processFuture.then((Process p) {
|
| - process = p;
|
| - process.onExit = processExitHandler;
|
| - var stdoutStringStream = new StringInputStream(process.stdout);
|
| - var stderrStringStream = new StringInputStream(process.stderr);
|
| - stdoutStringStream.onLine =
|
| - makeReadHandler(stdoutStringStream, stdout);
|
| - stderrStringStream.onLine =
|
| - makeReadHandler(stderrStringStream, stderr);
|
| - if (timeoutTimer == null) {
|
| - // Create one timeout timer when starting test case, remove it at
|
| - // the end.
|
| - timeoutTimer = new Timer(1000 * testCase.timeout, timeoutHandler);
|
| - }
|
| - // If the timeout fired in between two commands, kill the just
|
| - // started process immediately.
|
| - if (timedOut) safeKill(process);
|
| - });
|
| - processFuture.handleException((e) {
|
| - print("Process error:");
|
| - print(" Command: $command");
|
| - print(" Error: $e");
|
| - testComplete(createCommandOutput(command, -1, false));
|
| - return true;
|
| - });
|
| +
|
| + Future processFuture = Process.start(command.executable, command.arguments);
|
| + processFuture.then((Process p) {
|
| + process = p;
|
| + process.onExit = processExitHandler;
|
| + var stdoutStringStream = new StringInputStream(process.stdout);
|
| + var stderrStringStream = new StringInputStream(process.stderr);
|
| + stdoutStringStream.onLine =
|
| + makeReadHandler(stdoutStringStream, stdout);
|
| + stderrStringStream.onLine =
|
| + makeReadHandler(stderrStringStream, stderr);
|
| + if (timeoutTimer == null) {
|
| + // Create one timeout timer when starting test case, remove it at end.
|
| + timeoutTimer = new Timer(1000 * testCase.timeout, timeoutHandler);
|
| }
|
| + // If the timeout fired in between two commands, kill the just
|
| + // started process immediately.
|
| + if (timedOut) safeKill(process);
|
| + });
|
| + processFuture.handleException((e) {
|
| + print("Process error:");
|
| + print(" Command: $command");
|
| + print(" Error: $e");
|
| + testComplete(createCommandOutput(command, -1, false));
|
| + return true;
|
| });
|
| }
|
|
|
| @@ -1056,8 +959,7 @@ class BatchRunnerProcess {
|
| (outcome == "TIMEOUT"),
|
| _testStdout,
|
| _testStderr,
|
| - new Date.now().difference(_startTime),
|
| - false);
|
| + new Date.now().difference(_startTime));
|
| var test = _currentTest;
|
| _currentTest = null;
|
| test.completed();
|
|
|