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

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

Issue 13157004: Use the stack_trace library in scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes 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 | « pkg/scheduled_test/lib/src/task.dart ('k') | pkg/scheduled_test/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/src/utils.dart
diff --git a/pkg/scheduled_test/lib/src/utils.dart b/pkg/scheduled_test/lib/src/utils.dart
index 57c341d888d021bf454f006991a6ac50af5ac646..419e47eb8bc30e224f997cd5920922b9f844a36d 100644
--- a/pkg/scheduled_test/lib/src/utils.dart
+++ b/pkg/scheduled_test/lib/src/utils.dart
@@ -6,6 +6,8 @@ library utils;
import 'dart:async';
+import 'package:stack_trace/stack_trace.dart';
+
/// A pair of values.
class Pair<E, F> {
E first;
@@ -182,3 +184,12 @@ bool fullMatch(String string, Pattern pattern) {
if (matches.isEmpty) return false;
return matches.first.start == 0 && matches.first.end == string.length;
}
+
+/// Returns a string representation of [trace] that has the core and test frames
+/// folded together.
+String terseTraceString(StackTrace trace) {
+ return new Trace.from(trace).terse.foldFrames((frame) {
+ return frame.package == 'scheduled_test' || frame.package == 'unittest' ||
+ frame.isCore;
+ }).toString().trim();
+}
« no previous file with comments | « pkg/scheduled_test/lib/src/task.dart ('k') | pkg/scheduled_test/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698