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

Unified Diff: lib/src/backend/live_test.dart

Issue 1469863005: Add JSON protocol support for groups. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/backend/invoker.dart ('k') | lib/src/backend/live_test_controller.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/live_test.dart
diff --git a/lib/src/backend/live_test.dart b/lib/src/backend/live_test.dart
index 4cc917a5a4af3efb1dbcd30c8b87256600c23484..00b0d11cf2a748bac3dac79410b59be89de4d114 100644
--- a/lib/src/backend/live_test.dart
+++ b/lib/src/backend/live_test.dart
@@ -6,6 +6,7 @@ library test.backend.live_test;
import 'dart:async';
+import 'group.dart';
import 'state.dart';
import 'suite.dart';
import 'test.dart';
@@ -26,6 +27,12 @@ abstract class LiveTest {
/// The suite within which this test is being run.
Suite get suite;
+ /// The groups within which this test is being run, from the outermost to the
+ /// innermost.
+ ///
+ /// This will always contain at least the implicit top-level group.
+ List<Group> get groups;
+
/// The running test.
Test get test;
@@ -95,6 +102,19 @@ abstract class LiveTest {
/// to happen, which may cause further errors.
Future get onComplete;
+ /// The name of this live test without any group prefixes.
+ String get individualName {
+ var group = groups.last;
+ if (group.name == null) return test.name;
+ if (!test.name.startsWith(group.name)) return test.name;
+
+ // The test will have the same name as the group for virtual tests created
+ // to represent skipping the entire group.
+ if (test.name.length == group.name.length) return "";
+
+ return test.name.substring(group.name.length + 1);
+ }
+
/// Signals that this test should start running as soon as possible.
///
/// A test may not start running immediately for various reasons specific to
« no previous file with comments | « lib/src/backend/invoker.dart ('k') | lib/src/backend/live_test_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698