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

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

Issue 10911205: Print error output from DumpRenderTree updater in test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Do not commit injected error. Created 8 years, 3 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 | 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/drt_updater.dart
diff --git a/tools/testing/dart/drt_updater.dart b/tools/testing/dart/drt_updater.dart
index 7ddaf1f3544b571975253980299d15ddf98694de..725f7e2132572fe2c0c005673210bb3d50d2030e 100644
--- a/tools/testing/dart/drt_updater.dart
+++ b/tools/testing/dart/drt_updater.dart
@@ -15,7 +15,7 @@ class _DartiumUpdater {
bool updated = false;
List onUpdated;
- Process _updatingProcess;
+ Future<ProcessResult> _updatingProcess;
_DartiumUpdater(this.name, this.script, [this.option = null]);
@@ -24,27 +24,35 @@ class _DartiumUpdater {
isActive = true;
print('Updating $name.');
onUpdated = [() {updated = true;} ];
- _updatingProcess = Process.start('python', _getUpdateCommand);
- _updatingProcess.onExit = _onUpdatedHandler;
- _updatingProcess.onError = (error) {
- print("Error starting $script process: $error");
- _onUpdatedHandler(-1); // Continue anyway.
- };
+ _updatingProcess = Process.run('python', _getUpdateCommand);
+ _updatingProcess.handleException((e) {
+ print("Error starting $script process: $e");
+ return false;
+ });
+ _updatingProcess.then(_onUpdatedHandler);
}
}
List<String> get _getUpdateCommand {
- String scriptPath = new Options().script.replaceAll('\\', '/');
- String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/'));
- List<String> command = ['$toolsDir/$script'];
+ Path testScriptPath = new Path.fromNative(new Options().script);
+ Path updateScriptPath = testScriptPath.directoryPath.append(script);
+ List<String> command = [updateScriptPath.toNativePath()];
if (null !== option) {
command.add(option);
}
return command;
}
- void _onUpdatedHandler(int exit_code) {
- print('$name updated ($exit_code)');
+ void _onUpdatedHandler(ProcessResult result) {
+ if (result.exitCode == 0) {
+ print('$name updated');
+ } else {
+ print('Failure updating $name');
+ print(' Exit code: ${result.exitCode}');
+ print(result.stdout);
+ print(result.stderr);
+ exit(1);
+ }
for (var callback in onUpdated ) callback();
}
}
« no previous file with comments | « no previous file | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698