| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library("test_suite"); | 5 #library("test_suite"); |
| 6 | 6 |
| 7 #import("status_file_parser.dart"); | 7 #import("status_file_parser.dart"); |
| 8 #import("test_runner.dart"); | 8 #import("test_runner.dart"); |
| 9 #import("multitest.dart"); | 9 #import("multitest.dart"); |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 var p = new Process.start(runnerPath, ["--list"]); | 23 var p = new Process.start(runnerPath, ["--list"]); |
| 24 StringInputStream stdoutStream = new StringInputStream(p.stdout); | 24 StringInputStream stdoutStream = new StringInputStream(p.stdout); |
| 25 List<String> tests = new List<String>(); | 25 List<String> tests = new List<String>(); |
| 26 stdoutStream.lineHandler = () { | 26 stdoutStream.lineHandler = () { |
| 27 String line = stdoutStream.readLine(); | 27 String line = stdoutStream.readLine(); |
| 28 while (line != null) { | 28 while (line != null) { |
| 29 tests.add(line); | 29 tests.add(line); |
| 30 line = stdoutStream.readLine(); | 30 line = stdoutStream.readLine(); |
| 31 } | 31 } |
| 32 }; | 32 }; |
| 33 p.errorHandler = (error) { |
| 34 print("Failed to list tests: $runnerPath --list"); |
| 35 replyTo.send(""); |
| 36 }; |
| 33 p.exitHandler = (code) { | 37 p.exitHandler = (code) { |
| 34 if (code < 0) { | 38 if (code < 0) { |
| 35 print("Failed to list tests: $runnerPath --list"); | 39 print("Failed to list tests: $runnerPath --list"); |
| 36 replyTo.send(""); | 40 replyTo.send(""); |
| 37 } | 41 } |
| 38 for (String test in tests) { | 42 for (String test in tests) { |
| 39 replyTo.send(test); | 43 replyTo.send(test); |
| 40 } | 44 } |
| 41 replyTo.send(""); | 45 replyTo.send(""); |
| 42 }; | 46 }; |
| 47 port.close(); |
| 43 }); | 48 }); |
| 44 } | 49 } |
| 45 } | 50 } |
| 46 | 51 |
| 47 | 52 |
| 48 class CCTestSuite implements TestSuite { | 53 class CCTestSuite implements TestSuite { |
| 49 Map configuration; | 54 Map configuration; |
| 50 String suiteName; | 55 String suiteName; |
| 51 String runnerPath; | 56 String runnerPath; |
| 52 List<String> statusFilePaths; | 57 List<String> statusFilePaths; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // to run. | 92 // to run. |
| 88 var args = [testName]; | 93 var args = [testName]; |
| 89 args.addAll(TestUtils.standardOptions(configuration)); | 94 args.addAll(TestUtils.standardOptions(configuration)); |
| 90 | 95 |
| 91 doTest(new TestCase('$suiteName/$testName', | 96 doTest(new TestCase('$suiteName/$testName', |
| 92 runnerPath, | 97 runnerPath, |
| 93 args, | 98 args, |
| 94 configuration, | 99 configuration, |
| 95 completeHandler, | 100 completeHandler, |
| 96 expectations)); | 101 expectations)); |
| 97 | |
| 98 receiveTestName.receive(testNameHandler); | |
| 99 } | 102 } |
| 100 } | 103 } |
| 101 | 104 |
| 102 void forEachTest(Function onTest, Map testCache, [Function onDone]) { | 105 void forEachTest(Function onTest, Map testCache, [Function onDone]) { |
| 103 doTest = onTest; | 106 doTest = onTest; |
| 104 doDone = (ignore) => (onDone != null) ? onDone() : null; | 107 doDone = (ignore) => (onDone != null) ? onDone() : null; |
| 105 | 108 |
| 106 var filesRead = 0; | 109 var filesRead = 0; |
| 107 void statusFileRead() { | 110 void statusFileRead() { |
| 108 filesRead++; | 111 filesRead++; |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 * $noCrash tests are expected to be flaky but not crash | 1018 * $noCrash tests are expected to be flaky but not crash |
| 1016 * $pass tests are expected to pass | 1019 * $pass tests are expected to pass |
| 1017 * $failOk tests are expected to fail that we won't fix | 1020 * $failOk tests are expected to fail that we won't fix |
| 1018 * $fail tests are expected to fail that we should fix | 1021 * $fail tests are expected to fail that we should fix |
| 1019 * $crash tests are expected to crash that we should fix | 1022 * $crash tests are expected to crash that we should fix |
| 1020 * $timeout tests are allowed to timeout | 1023 * $timeout tests are allowed to timeout |
| 1021 """; | 1024 """; |
| 1022 print(report); | 1025 print(report); |
| 1023 } | 1026 } |
| 1024 } | 1027 } |
| OLD | NEW |