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

Unified Diff: lib/src/runner/runner_test.dart

Issue 2066113002: Add location information to the JSON reporter. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: cr Created 4 years, 6 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/reporter/json.dart ('k') | lib/src/util/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/runner_test.dart
diff --git a/lib/src/runner/runner_test.dart b/lib/src/runner/runner_test.dart
index 5f9526010bbfdd72a59cf909a2f0d8fd2b981a0e..87c16ae94369990e08accc73a919d6b7e0b6e235 100644
--- a/lib/src/runner/runner_test.dart
+++ b/lib/src/runner/runner_test.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:stack_trace/stack_trace.dart';
import 'package:stream_channel/stream_channel.dart';
import '../backend/group.dart';
@@ -22,6 +23,7 @@ typedef StackTrace _MapTrace(StackTrace trace);
class RunnerTest extends Test {
final String name;
final Metadata metadata;
+ final Trace trace;
/// The channel used to communicate with the test's [IframeListener].
final MultiChannel _channel;
@@ -29,7 +31,13 @@ class RunnerTest extends Test {
/// The function used to reformat errors' stack traces.
final _MapTrace _mapTrace;
- RunnerTest(this.name, this.metadata, this._channel, this._mapTrace);
+ RunnerTest(this.name, this.metadata, Trace trace, this._channel,
+ _MapTrace mapTrace)
+ : trace = trace == null ? null : new Trace.from(mapTrace(trace)),
+ _mapTrace = mapTrace;
+
+ RunnerTest._(this.name, this.metadata, this.trace, this._channel,
+ this._mapTrace);
LiveTest load(Suite suite, {Iterable<Group> groups}) {
var controller;
@@ -87,7 +95,11 @@ class RunnerTest extends Test {
Test forPlatform(TestPlatform platform, {OperatingSystem os}) {
if (!metadata.testOn.evaluate(platform, os: os)) return null;
- return new RunnerTest(
- name, metadata.forPlatform(platform, os: os), _channel, _mapTrace);
+ return new RunnerTest._(
+ name,
+ metadata.forPlatform(platform, os: os),
+ trace,
+ _channel,
+ _mapTrace);
}
}
« no previous file with comments | « lib/src/runner/reporter/json.dart ('k') | lib/src/util/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698