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

Side by Side Diff: pkg/unittest/test/skipped_soloed_nested_test.dart

Issue 524153002: Sharing metatest logic between unittest and scheduled_test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: status fixes Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/test/single_failing_test.dart ('k') | pkg/unittest/test/teardown_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library unittestTest; 5 library unittest.skipped_soloed_nested_test;
6
7 import 'dart:async';
8 import 'dart:isolate';
9 6
10 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
11 8
12 part 'utils.dart'; 9 import 'package:metatest/metatest.dart';
13 10
14 var testName = 'skipped/soloed nested groups with setup/teardown'; 11 void main() => initTests(_test);
15 12
16 var testFunction = (_) { 13 void _test(message) {
17 StringBuffer s = null; 14 initMetatest(message);
18 setUp(() { 15
19 if (s == null) s = new StringBuffer(); 16 expectTestResults('skipped/soloed nested groups with setup/teardown', () {
20 }); 17 StringBuffer s = null;
21 test('top level', () {
22 s.write('A');
23 });
24 skip_test('skipped top level', () {
25 s.write('B');
26 });
27 skip_group('skipped top level group', () {
28 setUp(() { 18 setUp(() {
29 s.write('C'); 19 if (s == null) s = new StringBuffer();
30 }); 20 });
31 solo_test('skipped solo nested test', () { 21 test('top level', () {
32 s.write('D'); 22 s.write('A');
33 }); 23 });
34 }); 24 skip_test('skipped top level', () {
35 group('non-solo group', () { 25 s.write('B');
36 setUp(() {
37 s.write('E');
38 }); 26 });
39 test('in non-solo group', () { 27 skip_group('skipped top level group', () {
40 s.write('F'); 28 setUp(() {
41 }); 29 s.write('C');
42 solo_test('solo_test in non-solo group', () {
43 s.write('G');
44 });
45 });
46 solo_group('solo group', () {
47 setUp(() {
48 s.write('H');
49 });
50 test('solo group non-solo test', () {
51 s.write('I');
52 });
53 solo_test('solo group solo test', () {
54 s.write('J');
55 });
56 group('nested non-solo group in solo group', () {
57 test('nested non-solo group non-solo test', () {
58 s.write('K');
59 }); 30 });
60 solo_test('nested non-solo group solo test', () { 31 solo_test('skipped solo nested test', () {
61 s.write('L'); 32 s.write('D');
62 }); 33 });
63 }); 34 });
64 }); 35 group('non-solo group', () {
65 solo_test('final', () { 36 setUp(() {
66 expect(s.toString(), "EGHIHJHKHL"); 37 s.write('E');
67 }); 38 });
68 }; 39 test('in non-solo group', () {
69 40 s.write('F');
70 var expected = buildStatusString(6, 0, 0, 41 });
71 'non-solo group solo_test in non-solo group::' 42 solo_test('solo_test in non-solo group', () {
72 'solo group solo group non-solo test::' 43 s.write('G');
73 'solo group solo group solo test::' 44 });
74 'solo group nested non-solo group in solo group nested non-' 45 });
75 'solo group non-solo test::' 46 solo_group('solo group', () {
76 'solo group nested non-solo group in solo' 47 setUp(() {
77 ' group nested non-solo group solo test::' 48 s.write('H');
78 'final'); 49 });
50 test('solo group non-solo test', () {
51 s.write('I');
52 });
53 solo_test('solo group solo test', () {
54 s.write('J');
55 });
56 group('nested non-solo group in solo group', () {
57 test('nested non-solo group non-solo test', () {
58 s.write('K');
59 });
60 solo_test('nested non-solo group solo test', () {
61 s.write('L');
62 });
63 });
64 });
65 solo_test('final', () {
66 expect(s.toString(), "EGHIHJHKHL");
67 });
68 }, [{
69 'description': 'non-solo group solo_test in non-solo group',
70 'result': 'pass',
71 }, {
72 'description': 'solo group solo group non-solo test',
73 'result': 'pass',
74 }, {
75 'description': 'solo group solo group solo test',
76 'result': 'pass',
77 }, {
78 'description': 'solo group nested non-solo group in solo group '
79 'nested non-solo group non-solo test',
80 'result': 'pass',
81 }, {
82 'description': 'solo group nested non-solo group in solo group '
83 'nested non-solo group solo test',
84 'result': 'pass',
85 }, {
86 'description': 'final',
87 'result': 'pass',
88 }]);
89 }
OLDNEW
« no previous file with comments | « pkg/unittest/test/single_failing_test.dart ('k') | pkg/unittest/test/teardown_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698