| Index: tools/testing/dart/test_suite.dart
|
| diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
|
| index 3ada3b77161286aaa3352734c6e8bfd3bbba3b38..3e2d725917e7866862bc15d34e2d98e143c28891 100644
|
| --- a/tools/testing/dart/test_suite.dart
|
| +++ b/tools/testing/dart/test_suite.dart
|
| @@ -65,31 +65,36 @@ bool Contains(element, collection) => collection.indexOf(element) >= 0;
|
|
|
| void ccTestLister() {
|
| port.receive((String runnerPath, SendPort replyTo) {
|
| - var p = Process.start(runnerPath, ["--list"]);
|
| - StringInputStream stdoutStream = new StringInputStream(p.stdout);
|
| - List<String> tests = new List<String>();
|
| - stdoutStream.onLine = () {
|
| - String line = stdoutStream.readLine();
|
| - while (line != null) {
|
| - tests.add(line);
|
| - line = stdoutStream.readLine();
|
| - }
|
| - };
|
| - p.onError = (error) {
|
| - print("Failed to list tests: $runnerPath --list");
|
| - replyTo.send("");
|
| - };
|
| - p.onExit = (code) {
|
| - if (code < 0) {
|
| - print("Failed to list tests: $runnerPath --list");
|
| + void processErrorHandler(error) {
|
| + }
|
| + Future processFuture = Process.start(runnerPath, ["--list"]);
|
| + processFuture.then((p) {
|
| + StringInputStream stdoutStream = new StringInputStream(p.stdout);
|
| + List<String> tests = new List<String>();
|
| + stdoutStream.onLine = () {
|
| + String line = stdoutStream.readLine();
|
| + while (line != null) {
|
| + tests.add(line);
|
| + line = stdoutStream.readLine();
|
| + }
|
| + };
|
| + p.onExit = (code) {
|
| + if (code < 0) {
|
| + print("Failed to list tests: $runnerPath --list");
|
| + replyTo.send("");
|
| + }
|
| + for (String test in tests) {
|
| + replyTo.send(test);
|
| + }
|
| replyTo.send("");
|
| - }
|
| - for (String test in tests) {
|
| - replyTo.send(test);
|
| - }
|
| + };
|
| + port.close();
|
| + });
|
| + processFuture.handleException((e) {
|
| + print("Failed to list tests: $runnerPath --list");
|
| replyTo.send("");
|
| - };
|
| - port.close();
|
| + return true;
|
| + });
|
| });
|
| }
|
|
|
|
|