Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: tests/standalone/src/TestRunnerTest.dart

Issue 8501004: Fix TestRunnerTest to actually fail if one of the test tests has unexpected output. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698