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

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

Issue 123213002: Added ScriptCommand,ScriptCommandOutputImpl classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/testing/dart/test_runner.dart
diff --git a/dart/tools/testing/dart/test_runner.dart b/dart/tools/testing/dart/test_runner.dart
index f83d85741a6d8a590ccb913e7241bf160b62aba8..d39598c0dd9b9e753136b3cea95bbab2bc337db1 100644
--- a/dart/tools/testing/dart/test_runner.dart
+++ b/dart/tools/testing/dart/test_runner.dart
@@ -362,6 +362,13 @@ class JSCommandlineCommand extends ProcessCommand {
environmentOverrides);
}
+/* [ScriptCommand]s are executed by dart code. */
+abstract class ScriptCommand extends Command {
+ ScriptCommand._(String displayName) : super._(displayName);
+
+ Future<ScriptCommandOutputImpl> run();
+}
+
class CommandBuilder {
static final CommandBuilder instance = new CommandBuilder._();
@@ -538,8 +545,9 @@ class TestCase extends UniqueObject {
}
bool get isFinished {
- return !lastCommandOutput.successful ||
- commands.length == commandOutputs.length;
+ return commandOutputs.length > 0 &&
+ (!lastCommandOutput.successful ||
+ commands.length == commandOutputs.length);
}
}
@@ -1329,6 +1337,24 @@ class JsCommandlineOutputImpl extends CommandOutputImpl
}
}
+class ScriptCommandOutputImpl extends CommandOutputImpl {
+ final Expectation _result;
+
+ ScriptCommandOutputImpl(ScriptCommand command, this._result,
+ String scriptExecutionInformation, Duration time)
+ : super(command, 0, false, [], [], time, false) {
+ var lines = scriptExecutionInformation.split("\n");
+ diagnostics.addAll(lines);
+ }
+
+ Expectation result(TestCase testCase) => _result;
+
+ bool get canRunDependendCommands => _result == Expectation.PASS;
+
+ bool get successful => _result == Expectation.PASS;
+
+}
+
CommandOutput createCommandOutput(Command command,
int exitCode,
bool timedOut,
@@ -2054,6 +2080,8 @@ class CommandExecutorImpl implements CommandExecutor {
} else if (command is AnalysisCommand && batchMode) {
return _getBatchRunner(command.flavor)
.runCommand(command.flavor, command, timeout, command.arguments);
+ } else if (command is ScriptCommand) {
+ return command.run();
} else {
return new RunningProcess(command, timeout).run();
}
« 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