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

Unified Diff: pkg/scheduled_test/lib/src/schedule.dart

Issue 12512005: Display which nested tasks are running when an error occurs in a scheduled test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « no previous file | pkg/scheduled_test/lib/src/task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/src/schedule.dart
diff --git a/pkg/scheduled_test/lib/src/schedule.dart b/pkg/scheduled_test/lib/src/schedule.dart
index d4a612d2605856c28b283f8eff194eb622aa0b73..12783da7b361237d2e0927139ea4d4dddfd33af1 100644
--- a/pkg/scheduled_test/lib/src/schedule.dart
+++ b/pkg/scheduled_test/lib/src/schedule.dart
@@ -13,6 +13,7 @@ import 'mock_clock.dart' as mock_clock;
import 'schedule_error.dart';
import 'substitute_future.dart';
import 'task.dart';
+import 'value_future.dart';
/// The schedule of tasks to run for a single test. This has three separate task
/// queues: [tasks], [onComplete], and [onException]. It also provides
@@ -532,6 +533,22 @@ class TaskQueue {
"> ${lines.first}" : "* ${lines.first}";
lines = new List.from(lines.skip(1).map((line) => "| $line"));
lines.insertRange(0, 1, firstLine);
+
+ if (task == highlight && !task.children.isEmpty) {
+ for (var child in task.children) {
+ var prefix = ">";
+ if (child.state == TaskState.ERROR) {
+ prefix = "X";
+ } else if (child.state == TaskState.SUCCESS) {
+ prefix = "*";
+ }
+
+ var childLines = child.toString().split("\n");
+ lines.add(" $prefix ${childLines.first}");
+ lines.addAll(childLines.skip(1).map((line) => " | $line"));
+ }
+ }
+
return lines.join("\n");
}).join("\n");
}
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698