Chromium Code Reviews| Index: tests/standalone/io/test_runner_exit_code_test.dart |
| diff --git a/tests/standalone/io/test_runner_exit_code_test.dart b/tests/standalone/io/test_runner_exit_code_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9799ebbd897740b9f42244e4ff1655cfff6708b2 |
| --- /dev/null |
| +++ b/tests/standalone/io/test_runner_exit_code_test.dart |
| @@ -0,0 +1,31 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +#import('dart:io'); |
| + |
| +void runTests(String executable, String script, Iterator iterator) { |
|
ahe
2012/10/08 07:58:55
Consider using a list instead of an iterator...
|
| + if (iterator.hasNext()) { |
| + var progressIndicator = iterator.next(); |
|
ahe
2012/10/08 07:58:56
... then these two lines can be:
for (String prog
Mads Ager (google)
2012/10/08 08:00:49
They could, but then you would start all the proce
ahe
2012/10/08 08:02:43
Doh. I misread the code :-)
|
| + Process.run(executable, [script, progressIndicator]).then((result) { |
| + Expect.equals(1, result.exitCode); |
| + if (progressIndicator == 'buildbot') { |
| + Expect.isTrue(result.stdout.contains("@@@STEP_FAILURE@@@")); |
|
Emily Fortuna
2012/10/08 17:50:06
The "@@@STEP_FAILURE@@" string is only printed out
|
| + } |
| + runTests(executable, script, iterator); |
| + }); |
| + } |
| +} |
| + |
| +main() { |
| + var scriptPath = new Path.fromNative(new Options().script); |
| + var scriptDirPath = scriptPath.directoryPath; |
| + var exitCodeScriptPath = |
| + scriptDirPath.append('test_runner_exit_code_script.dart'); |
| + var script = exitCodeScriptPath.toNativePath(); |
| + var executable = new Options().executable; |
| + var progressTypes = ['compact', 'color', 'line', 'verbose', |
| + 'status', 'buildbot']; |
| + var iterator = progressTypes.iterator(); |
| + runTests(executable, script, iterator); |
| +} |