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

Side by Side Diff: lib/src/backend/declarer.dart

Issue 2099553002: Add an option to run 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 | « doc/configuration.md ('k') | lib/src/runner.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:stack_trace/stack_trace.dart'; 7 import 'package:stack_trace/stack_trace.dart';
8 8
9 import '../frontend/timeout.dart'; 9 import '../frontend/timeout.dart';
10 import '../utils.dart'; 10 import '../utils.dart';
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 /// Creates a group of tests. 112 /// Creates a group of tests.
113 void group(String name, void body(), {String testOn, Timeout timeout, skip, 113 void group(String name, void body(), {String testOn, Timeout timeout, skip,
114 Map<String, dynamic> onPlatform, tags}) { 114 Map<String, dynamic> onPlatform, tags}) {
115 _checkNotBuilt("group"); 115 _checkNotBuilt("group");
116 116
117 var metadata = _metadata.merge(new Metadata.parse( 117 var metadata = _metadata.merge(new Metadata.parse(
118 testOn: testOn, timeout: timeout, skip: skip, onPlatform: onPlatform, 118 testOn: testOn, timeout: timeout, skip: skip, onPlatform: onPlatform,
119 tags: tags)); 119 tags: tags));
120 var trace = new Trace.current(2); 120 var trace = new Trace.current(2);
121 121
122 // Don't load the tests for a skipped group.
123 if (metadata.skip) {
124 _entries.add(new Group(name, [], metadata: metadata, trace: trace));
125 return;
126 }
127
128 var declarer = new Declarer._(this, _prefix(name), metadata, trace); 122 var declarer = new Declarer._(this, _prefix(name), metadata, trace);
129 declarer.declare(body); 123 declarer.declare(body);
130 _entries.add(declarer.build()); 124 _entries.add(declarer.build());
131 } 125 }
132 126
133 /// Returns [name] prefixed with this declarer's group name. 127 /// Returns [name] prefixed with this declarer's group name.
134 String _prefix(String name) => _name == null ? name : "$_name $name"; 128 String _prefix(String name) => _name == null ? name : "$_name $name";
135 129
136 /// Registers a function to be run before each test in this group. 130 /// Registers a function to be run before each test in this group.
137 void setUp(callback()) { 131 void setUp(callback()) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 var completer = new Completer(); 228 var completer = new Completer();
235 229
236 Invoker.current.addOutstandingCallback(); 230 Invoker.current.addOutstandingCallback();
237 Invoker.current.waitForOutstandingCallbacks(() { 231 Invoker.current.waitForOutstandingCallbacks(() {
238 new Future.sync(body).whenComplete(completer.complete); 232 new Future.sync(body).whenComplete(completer.complete);
239 }).then((_) => Invoker.current.removeOutstandingCallback()); 233 }).then((_) => Invoker.current.removeOutstandingCallback());
240 234
241 return completer.future; 235 return completer.future;
242 } 236 }
243 } 237 }
OLDNEW
« no previous file with comments | « doc/configuration.md ('k') | lib/src/runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698