OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 @TestOn("vm") | 5 @TestOn("vm") |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
10 import 'package:test/src/util/io.dart'; | 10 import 'package:test/src/util/io.dart'; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 test.dart 7:33 main.<fn> | 51 test.dart 7:33 main.<fn> |
52 | 52 |
53 +0 -2: failure 3 | 53 +0 -2: failure 3 |
54 +0 -3: failure 3 | 54 +0 -3: failure 3 |
55 oh no | 55 oh no |
56 test.dart 8:33 main.<fn> | 56 test.dart 8:33 main.<fn> |
57 | 57 |
58 +0 -3: Some tests failed."""); | 58 +0 -3: Some tests failed."""); |
59 }); | 59 }); |
60 | 60 |
| 61 test("includes the full stack trace with --verbose-trace", () { |
| 62 return withTempDir((path) { |
| 63 new File(p.join(path, "test.dart")).writeAsStringSync(""" |
| 64 import 'dart:async'; |
| 65 |
| 66 import 'package:test/test.dart'; |
| 67 |
| 68 void main() { |
| 69 test("failure", () => throw "oh no"); |
| 70 } |
| 71 """); |
| 72 var result = runTest(["-r", "compact", "--verbose-trace", "test.dart"], |
| 73 workingDirectory: path); |
| 74 expect(result.stdout, contains("dart:isolate-patch")); |
| 75 }); |
| 76 }); |
| 77 |
61 test("runs failing tests along with successful tests", () { | 78 test("runs failing tests along with successful tests", () { |
62 _expectReport(""" | 79 _expectReport(""" |
63 test('failure 1', () => throw new TestFailure('oh no')); | 80 test('failure 1', () => throw new TestFailure('oh no')); |
64 test('success 1', () {}); | 81 test('success 1', () {}); |
65 test('failure 2', () => throw new TestFailure('oh no')); | 82 test('failure 2', () => throw new TestFailure('oh no')); |
66 test('success 2', () {});""", | 83 test('success 2', () {});""", |
67 """ | 84 """ |
68 +0: failure 1 | 85 +0: failure 1 |
69 +0 -1: failure 1 | 86 +0 -1: failure 1 |
70 oh no | 87 oh no |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // Un-indent the expected string. | 330 // Un-indent the expected string. |
314 var indentation = expected.indexOf(new RegExp("[^ ]")); | 331 var indentation = expected.indexOf(new RegExp("[^ ]")); |
315 expected = expected.split("\n").map((line) { | 332 expected = expected.split("\n").map((line) { |
316 if (line.isEmpty) return line; | 333 if (line.isEmpty) return line; |
317 return line.substring(indentation); | 334 return line.substring(indentation); |
318 }).join("\n"); | 335 }).join("\n"); |
319 | 336 |
320 expect(actual, equals(expected)); | 337 expect(actual, equals(expected)); |
321 }), completes); | 338 }), completes); |
322 } | 339 } |
OLD | NEW |