Use the new test package.
R=rnystrom@google.com
Review URL: https://codereview.chromium.org//1172523003.
diff --git a/.status b/.status
deleted file mode 100644
index 56ba102..0000000
--- a/.status
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-# 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.
-
-# Skip non-test files ending with "_test".
-packages/*: Skip
-*/packages/*: Skip
-*/*/packages/*: Skip
-*/*/*/packages/*: Skip
-*/*/*/*packages/*: Skip
-*/*/*/*/*packages/*: Skip
-
-# Only run tests from the build directory, since we don't care about the
-# difference between transformed an untransformed code.
-test/*: Skip
-
-[ $runtime == d8 || $runtime == jsshell ]
-build/test/chain_test: Fail # Issues 15171 and 15105
-build/test/vm_test: RuntimeError, OK # VM-specific traces
-
-[ $compiler == dart2js && $browser ]
-build/test/vm_test: Fail, OK # VM-specific traces
-build/test/chain_test: Fail # Issues 15171 and 15105
diff --git a/pubspec.yaml b/pubspec.yaml
index f69417d..9b8413d 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -14,9 +14,9 @@
A package for manipulating stack traces and printing them readably.
dependencies:
- path: ">=1.2.0 <2.0.0"
+ path: "^1.2.0"
dev_dependencies:
- unittest: ">=0.9.0 <0.12.0"
+ test: "^0.12.0"
environment:
- sdk: ">=1.7.0-dev.4.0 <2.0.0"
+ sdk: ">=1.8.0 <2.0.0"
diff --git a/test/chain_test.dart b/test/chain_test.dart
index 0b6f36e..65d6790 100644
--- a/test/chain_test.dart
+++ b/test/chain_test.dart
@@ -2,13 +2,14 @@
// 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.
-library chain_test;
+// dart2js currently doesn't support chain-capturing. See sdk#15171.
+@TestOn('vm')
import 'dart:async';
import 'package:path/path.dart' as p;
import 'package:stack_trace/stack_trace.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
import 'utils.dart';
@@ -349,16 +350,21 @@
test('current() outside of capture() returns a chain wrapping the current '
'trace', () {
- var completer = new Completer();
- inMicrotask(() => completer.complete(new Chain.current()));
+ // The test runner runs all tests with chains enabled, so to test without we
+ // have to do some zone munging.
+ return runZoned(() {
+ var completer = new Completer();
+ inMicrotask(() => completer.complete(new Chain.current()));
- return completer.future.then((chain) {
- // Since the chain wasn't loaded within [Chain.capture], the full stack
- // chain isn't available and it just returns the current stack when
- // called.
- expect(chain.traces, hasLength(1));
- expect(chain.traces.first.frames.first, frameMember(startsWith('main')));
- });
+ return completer.future.then((chain) {
+ // Since the chain wasn't loaded within [Chain.capture], the full stack
+ // chain isn't available and it just returns the current stack when
+ // called.
+ expect(chain.traces, hasLength(1));
+ expect(chain.traces.first.frames.first,
+ frameMember(startsWith('main')));
+ });
+ }, zoneValues: {#stack_trace.stack_zone.spec: null});
});
group('forTrace() within capture()', () {
diff --git a/test/frame_test.dart b/test/frame_test.dart
index c2cb80e..01177f0 100644
--- a/test/frame_test.dart
+++ b/test/frame_test.dart
@@ -6,7 +6,7 @@
import 'package:path/path.dart' as path;
import 'package:stack_trace/stack_trace.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
void main() {
group('.parseVM', () {
diff --git a/test/trace_test.dart b/test/trace_test.dart
index 7fb9b5b..14e1e2b 100644
--- a/test/trace_test.dart
+++ b/test/trace_test.dart
@@ -6,7 +6,7 @@
import 'package:path/path.dart' as path;
import 'package:stack_trace/stack_trace.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
String getStackTraceString() {
try {
diff --git a/test/utils.dart b/test/utils.dart
index ed75631..912f8f4 100644
--- a/test/utils.dart
+++ b/test/utils.dart
@@ -4,7 +4,7 @@
library stack_trace.test.utils;
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
/// Returns a matcher that runs [matcher] against a [Frame]'s `member` field.
Matcher frameMember(matcher) =>
diff --git a/test/vm_test.dart b/test/vm_test.dart
index 7e00b7a..48ca375 100644
--- a/test/vm_test.dart
+++ b/test/vm_test.dart
@@ -6,10 +6,11 @@
/// dual of dartium_test.dart, since method names can differ somewhat from
/// platform to platform. No similar file exists for dart2js since the specific
/// method names there are implementation details.
+@TestOn('vm')
import 'package:path/path.dart' as path;
import 'package:stack_trace/stack_trace.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
String getStackTraceString() {
try {