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

Unified Diff: lib/src/runner/reporter/json.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/runner/loader.dart ('k') | test/runner/compact_reporter_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/reporter/json.dart
diff --git a/lib/src/runner/reporter/json.dart b/lib/src/runner/reporter/json.dart
index 3348bddda8f3d6030e75a70e473ad74564fc09bd..1d6be91b5a1f06c0837352171b90f30bcca2255a 100644
--- a/lib/src/runner/reporter/json.dart
+++ b/lib/src/runner/reporter/json.dart
@@ -27,6 +27,9 @@ class JsonReporter implements Reporter {
/// Whether to emit location information for JS tests.
final bool _jsLocations;
+ /// Whether skipped tests are run anyway.
+ final bool _runSkipped;
+
/// The engine used to run the tests.
final Engine _engine;
@@ -63,15 +66,18 @@ class JsonReporter implements Reporter {
/// [jsLocations] is `false`, this will not emit location information for JS
/// tests.
static JsonReporter watch(Engine engine, {bool verboseTrace: false,
- bool jsLocations: true}) {
+ bool jsLocations: true, bool runSkipped: false}) {
return new JsonReporter._(engine,
- verboseTrace: verboseTrace, jsLocations: jsLocations);
+ verboseTrace: verboseTrace,
+ jsLocations: jsLocations,
+ runSkipped: runSkipped);
}
JsonReporter._(this._engine, {bool verboseTrace: false,
- bool jsLocations: true})
+ bool jsLocations: true, bool runSkipped: false})
: _verboseTrace = verboseTrace,
- _jsLocations = jsLocations {
+ _jsLocations = jsLocations,
+ _runSkipped = runSkipped {
_subscriptions.add(_engine.onTestStarted.listen(_onTestStarted));
/// Convert the future to a stream so that the subscription can be paused or
@@ -223,8 +229,9 @@ class JsonReporter implements Reporter {
}
/// Serializes [metadata] into a JSON-protocol-compatible map.
- Map _serializeMetadata(Metadata metadata) =>
- {"skip": metadata.skip, "skipReason": metadata.skipReason};
+ Map _serializeMetadata(Metadata metadata) => _runSkipped
+ ? {"skip": false, "skipReason": null}
+ : {"skip": metadata.skip, "skipReason": metadata.skipReason};
/// A callback called when [liveTest] finishes running.
void _onComplete(LiveTest liveTest) {
« no previous file with comments | « lib/src/runner/loader.dart ('k') | test/runner/compact_reporter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698