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

Side by Side Diff: test/runner/engine_test.dart

Issue 2099503002: Add a dedicated Result for skipped tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 5 months 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
« no previous file with comments | « lib/src/runner/reporter/json.dart ('k') | test/runner/json_reporter_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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:async'; 5 import 'dart:async';
6 6
7 import 'package:test/src/backend/group.dart'; 7 import 'package:test/src/backend/group.dart';
8 import 'package:test/src/backend/state.dart'; 8 import 'package:test/src/backend/state.dart';
9 import 'package:test/src/runner/engine.dart'; 9 import 'package:test/src/runner/engine.dart';
10 import 'package:test/src/runner/plugin/environment.dart'; 10 import 'package:test/src/runner/plugin/environment.dart';
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 }); 165 });
166 166
167 var engine = new Engine.withSuites([ 167 var engine = new Engine.withSuites([
168 new RunnerSuite(const PluginEnvironment(), new Group.root(tests)) 168 new RunnerSuite(const PluginEnvironment(), new Group.root(tests))
169 ]); 169 ]);
170 170
171 engine.onTestStarted.listen(expectAsync((liveTest) { 171 engine.onTestStarted.listen(expectAsync((liveTest) {
172 expect(liveTest, same(engine.liveTests.single)); 172 expect(liveTest, same(engine.liveTests.single));
173 expect(liveTest.test.name, equals(tests.single.name)); 173 expect(liveTest.test.name, equals(tests.single.name));
174 174
175 var first = true; 175 var i = 0;
176 liveTest.onStateChange.listen(expectAsync((state) { 176 liveTest.onStateChange.listen(expectAsync((state) {
177 expect(state, equals(first 177 if (i == 0) {
178 ? const State(Status.running, Result.success) 178 expect(state, equals(const State(Status.running, Result.success)));
179 : const State(Status.complete, Result.success))); 179 } else if (i == 1) {
180 first = false; 180 expect(state, equals(const State(Status.running, Result.skipped)));
181 }, count: 2)); 181 } else if (i == 2) {
182 expect(state, equals(const State(Status.complete, Result.skipped)));
183 }
184 i++;
185 }, count: 3));
182 186
183 expect(liveTest.onComplete, completes); 187 expect(liveTest.onComplete, completes);
184 })); 188 }));
185 189
186 return engine.run(); 190 return engine.run();
187 }); 191 });
188 }); 192 });
189 } 193 }
OLDNEW
« no previous file with comments | « lib/src/runner/reporter/json.dart ('k') | test/runner/json_reporter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698