| OLD | NEW |
| 1 | 1 |
| 2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 #library("TestRunnerTest"); | 6 #library("TestRunnerTest"); |
| 7 | 7 |
| 8 | 8 |
| 9 #import("../../../tools/testing/dart/test_runner.dart"); | 9 #import("../../../tools/testing/dart/test_runner.dart"); |
| 10 | 10 |
| 11 // TODO(whesse) source("ProcessTestUtil.dart"); when it is committed. | 11 // TODO(whesse) source("ProcessTestUtil.dart"); when it is committed. |
| 12 | 12 |
| 13 class TestController { | 13 class TestController { |
| 14 static final int numTests = 4; | 14 static final int numTests = 4; |
| 15 static int numCompletedTests = 0; | 15 static int numCompletedTests = 0; |
| 16 | 16 |
| 17 // Used as TestCase.completedCallback. | 17 // Used as TestCase.completedCallback. |
| 18 static processCompletedTest(TestCase testCase) { | 18 static processCompletedTest(TestCase testCase) { |
| 19 TestOutput output = testCase.output; | 19 TestOutput output = testCase.output; |
| 20 print("Test: ${testCase.commandLine}"); | 20 print("Test: ${testCase.commandLine}"); |
| 21 if (output.unexpectedOutput) { | 21 if (output.unexpectedOutput) { |
| 22 print("Unexpected output: ${output.result}"); | 22 throw "Unexpected output: ${output.result}"; |
| 23 } | 23 } |
| 24 print("stdout: "); | 24 print("stdout: "); |
| 25 for (var line in output.stdout) print(line); | 25 for (var line in output.stdout) print(line); |
| 26 print("stderr: "); | 26 print("stderr: "); |
| 27 for (var line in output.stderr) print(line); | 27 for (var line in output.stderr) print(line); |
| 28 | 28 |
| 29 print("Time: ${output.time}"); | 29 print("Time: ${output.time}"); |
| 30 print("Exit code: ${output.exitCode}"); | 30 print("Exit code: ${output.exitCode}"); |
| 31 | 31 |
| 32 ++numCompletedTests; | 32 ++numCompletedTests; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 const ["0", "0", "1", "1"], | 77 const ["0", "0", "1", "1"], |
| 78 TestController.processCompletedTest, | 78 TestController.processCompletedTest, |
| 79 new Set<String>.from([CRASH])), | 79 new Set<String>.from([CRASH])), |
| 80 timeout).start(); | 80 timeout).start(); |
| 81 Expect.equals(4, TestController.numTests); | 81 Expect.equals(4, TestController.numTests); |
| 82 // Throw must be from body of start() function for this test to work. | 82 // Throw must be from body of start() function for this test to work. |
| 83 Expect.throws( | 83 Expect.throws( |
| 84 new RunningProcess(MakeTestCase("PassTest", [SKIP]), timeout).start); | 84 new RunningProcess(MakeTestCase("PassTest", [SKIP]), timeout).start); |
| 85 } | 85 } |
| 86 | 86 |
| OLD | NEW |