Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import "dart:io"; | 5 import "dart:io"; |
| 6 import "dart:isolate"; | 6 import "dart:isolate"; |
| 7 import "dart:async"; | 7 import "dart:async"; |
| 8 import "../../../tools/testing/dart/test_runner.dart"; | 8 import "../../../tools/testing/dart/test_runner.dart"; |
| 9 import "../../../tools/testing/dart/test_suite.dart"; | 9 import "../../../tools/testing/dart/test_suite.dart"; |
| 10 import "../../../tools/testing/dart/test_progress.dart" as progress; | 10 import "../../../tools/testing/dart/test_progress.dart" as progress; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 static processCompletedTest(TestCase testCase) { | 23 static processCompletedTest(TestCase testCase) { |
| 24 numCompletedTests++; | 24 numCompletedTests++; |
| 25 if (testCase.displayName == "fail-unexpected") { | 25 if (testCase.displayName == "fail-unexpected") { |
| 26 if (!testCase.unexpectedOutput) { | 26 if (!testCase.unexpectedOutput) { |
| 27 var stdout = | 27 var stdout = |
| 28 new String.fromCharCodes(testCase.lastCommandOutput.stdout); | 28 new String.fromCharCodes(testCase.lastCommandOutput.stdout); |
| 29 var stderr = | 29 var stderr = |
| 30 new String.fromCharCodes(testCase.lastCommandOutput.stderr); | 30 new String.fromCharCodes(testCase.lastCommandOutput.stderr); |
| 31 print("stdout = [$stdout]"); | 31 print("stdout = [$stdout]"); |
| 32 print("stderr = [$stderr]"); | 32 print("stderr = [$stderr]"); |
| 33 throw "Expected fail-unexpected: ${testCase.result}"; | 33 throw "Test case ${testCase.displayName} passed unexpectedly, " |
| 34 "result == ${testCase.result}"; | |
|
kustermann
2014/06/16 08:26:29
Indentation.
| |
| 34 } | 35 } |
| 35 } else { | 36 } else { |
| 36 if (testCase.unexpectedOutput) { | 37 if (testCase.unexpectedOutput) { |
| 37 var stdout = | 38 var stdout = |
| 38 new String.fromCharCodes(testCase.lastCommandOutput.stdout); | 39 new String.fromCharCodes(testCase.lastCommandOutput.stdout); |
| 39 var stderr = | 40 var stderr = |
| 40 new String.fromCharCodes(testCase.lastCommandOutput.stderr); | 41 new String.fromCharCodes(testCase.lastCommandOutput.stderr); |
| 41 print("stdout = [$stdout]"); | 42 print("stdout = [$stdout]"); |
| 42 print("stderr = [$stderr]"); | 43 print("stderr = [$stderr]"); |
| 43 throw "Unexpected fail"; | 44 throw "Test case ${testCase.displayName} failed, " |
| 45 "result == ${testCase.result}"; | |
|
kustermann
2014/06/16 08:26:29
ditto.
| |
| 44 } | 46 } |
| 45 } | 47 } |
| 46 } | 48 } |
| 47 | 49 |
| 48 static void finished() { | 50 static void finished() { |
| 49 if (numTests != numCompletedTests) { | 51 if (numTests != numCompletedTests) { |
| 50 throw "bad completion count. " | 52 throw "bad completion count. " |
| 51 "expected: $numTests, actual: $numCompletedTests"; | 53 "expected: $numTests, actual: $numCompletedTests"; |
| 52 } | 54 } |
| 53 } | 55 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 break; | 143 break; |
| 142 case 'timeout': | 144 case 'timeout': |
| 143 // This process should be killed by the test after DEFAULT_TIMEOUT | 145 // This process should be killed by the test after DEFAULT_TIMEOUT |
| 144 new Timer(new Duration(hours: 42), (){ }); | 146 new Timer(new Duration(hours: 42), (){ }); |
| 145 break; | 147 break; |
| 146 default: | 148 default: |
| 147 throw "Unknown option ${arguments[0]} passed to test_runner_test"; | 149 throw "Unknown option ${arguments[0]} passed to test_runner_test"; |
| 148 } | 150 } |
| 149 } | 151 } |
| 150 } | 152 } |
| OLD | NEW |