| Index: tools/testing/dart/test_runner.dart
|
| ===================================================================
|
| --- tools/testing/dart/test_runner.dart (revision 36164)
|
| +++ tools/testing/dart/test_runner.dart (working copy)
|
| @@ -93,9 +93,6 @@
|
| String toString() => reproductionCommand;
|
|
|
| Future<bool> get outputIsUpToDate => new Future.value(false);
|
| -
|
| - Future<String> get cachedOutput => new Future.value(null);
|
| - Future writeCachedOutput(CommandOutput output) => new Future.value(null);
|
| }
|
|
|
| class ProcessCommand extends Command {
|
| @@ -175,24 +172,6 @@
|
| bool _neverSkipCompilation;
|
| List<Uri> _bootstrapDependencies;
|
|
|
| - Future writeCachedOutput(CommandOutput output) {
|
| - var file = new io.File(TestUtils.cachedOutputFile(_outputFile));
|
| - return file.writeAsString(output.json)
|
| - .catchError((error) {
|
| - DebugLogger.warning("Could not write cached output: $error");
|
| - return null;
|
| - });
|
| - }
|
| -
|
| - Future<CommandOutput> get cachedOutput {
|
| - var file = new io.File(TestUtils.cachedOutputFile(_outputFile));
|
| - return file.exists().then((exists) {
|
| - if (exists) return file.readAsString().then((content) {
|
| - return new CompilationCommandOutputImpl.fromJson(this, content);
|
| - });;
|
| - });
|
| - }
|
| -
|
| CompilationCommand._(String displayName,
|
| this._outputFile,
|
| this._neverSkipCompilation,
|
| @@ -226,28 +205,22 @@
|
| });
|
| }
|
|
|
| - bool isUpToDate(lastModified, dependencies) {
|
| - if (lastModified == null) return false;
|
| - for (var dependency in dependencies) {
|
| - var dependencyLastModified =
|
| - TestUtils.lastModifiedCache.getLastModified(dependency);
|
| - if (dependencyLastModified == null ||
|
| - dependencyLastModified.isAfter(lastModified)) {
|
| - return false;
|
| - }
|
| - }
|
| - return true;
|
| - }
|
| -
|
| return readDepsFile("$_outputFile.deps").then((dependencies) {
|
| if (dependencies != null) {
|
| dependencies.addAll(_bootstrapDependencies);
|
| - // We check if the cached output is up to date, if so we return true
|
| - var cachedOutputFile = TestUtils.cachedOutputFile(_outputFile);
|
| - var cachedOutputUri = new Uri(scheme: 'file', path: cachedOutputFile);
|
| - var cachedOutputLastModified =
|
| - TestUtils.lastModifiedCache.getLastModified(cachedOutputUri);
|
| - return isUpToDate(cachedOutputLastModified, dependencies);
|
| + var jsOutputLastModified = TestUtils.lastModifiedCache.getLastModified(
|
| + new Uri(scheme: 'file', path: _outputFile));
|
| + if (jsOutputLastModified != null) {
|
| + for (var dependency in dependencies) {
|
| + var dependencyLastModified =
|
| + TestUtils.lastModifiedCache.getLastModified(dependency);
|
| + if (dependencyLastModified == null ||
|
| + dependencyLastModified.isAfter(jsOutputLastModified)) {
|
| + return false;
|
| + }
|
| + }
|
| + return true;
|
| + }
|
| }
|
| return false;
|
| });
|
| @@ -946,8 +919,6 @@
|
| List<String> get diagnostics;
|
|
|
| bool get compilationSkipped;
|
| -
|
| - String get json;
|
| }
|
|
|
| class CommandOutputImpl extends UniqueObject implements CommandOutput {
|
| @@ -1037,9 +1008,6 @@
|
| }
|
| return Expectation.FAIL;
|
| }
|
| -
|
| - String get json => null;
|
| -
|
| }
|
|
|
| class BrowserCommandOutputImpl extends CommandOutputImpl {
|
| @@ -1637,32 +1605,6 @@
|
| exitCode == 0 ? Expectation.PASS : Expectation.COMPILETIME_ERROR;
|
| return _negateOutcomeIfNegativeTest(outcome, testCase.isNegative);
|
| }
|
| -
|
| - String get json {
|
| - var map = {
|
| - 'stdout': stdout,
|
| - 'stderr': stderr,
|
| - 'exitCode': exitCode,
|
| - 'timedOut': timedOut,
|
| - };
|
| - return JSON.encode(map);
|
| - }
|
| -
|
| - factory CompilationCommandOutputImpl.fromJson(Command command,
|
| - String json) {
|
| - var obj = JSON.decode(json);
|
| - for (var v in ['stdout', 'stderr', 'exitCode', 'timedOut']) {
|
| - assert(obj.containsKey(v));
|
| - }
|
| - return new CompilationCommandOutputImpl(command,
|
| - obj['exitCode'],
|
| - obj['timedOut'],
|
| - obj['stdout'],
|
| - obj['stderr'],
|
| - const Duration(seconds: 0),
|
| - true);
|
| -
|
| - }
|
| }
|
|
|
| class JsCommandlineOutputImpl extends CommandOutputImpl
|
| @@ -1860,12 +1802,10 @@
|
| }
|
|
|
| void _runCommand() {
|
| - command.outputIsUpToDate.then((isUpToDate) {
|
| + command.outputIsUpToDate.then((bool isUpToDate) {
|
| if (isUpToDate) {
|
| compilationSkipped = true;
|
| - command.cachedOutput.then((cached) {
|
| - _commandComplete(cached.exitCode, cachedOutput: cached);
|
| - });
|
| + _commandComplete(0);
|
| } else {
|
| var processEnvironment = _createProcessEnvironment();
|
| Future processFuture =
|
| @@ -1958,17 +1898,12 @@
|
| });
|
| }
|
|
|
| - void _commandComplete(int exitCode, {cachedOutput: null}) {
|
| + void _commandComplete(int exitCode) {
|
| if (timeoutTimer != null) {
|
| timeoutTimer.cancel();
|
| }
|
| - if (cachedOutput != null) {
|
| - completer.complete(cachedOutput);
|
| - } else {
|
| - var commandOutput = _createCommandOutput(command, exitCode);
|
| - command.writeCachedOutput(commandOutput);
|
| - completer.complete(commandOutput);
|
| - }
|
| + var commandOutput = _createCommandOutput(command, exitCode);
|
| + completer.complete(commandOutput);
|
| }
|
|
|
| CommandOutput _createCommandOutput(ProcessCommand command, int exitCode) {
|
|
|