Chromium Code Reviews

Side by Side Diff: test/runner/loader_test.dart

Issue 2091173002: Add metadata to messages emitted by live tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « test/runner/json_reporter_test.dart ('k') | no next file » | 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) 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/backend/state.dart'; 10 import 'package:test/src/backend/state.dart';
(...skipping 135 matching lines...)
146 void main() { 146 void main() {
147 print('print within test'); 147 print('print within test');
148 } 148 }
149 """); 149 """);
150 var suites = await _loader.loadFile(p.join(_sandbox, 'a_test.dart')) 150 var suites = await _loader.loadFile(p.join(_sandbox, 'a_test.dart'))
151 .toList(); 151 .toList();
152 expect(suites, hasLength(1)); 152 expect(suites, hasLength(1));
153 var loadSuite = suites.first; 153 var loadSuite = suites.first;
154 154
155 var liveTest = await loadSuite.group.entries.single.load(loadSuite); 155 var liveTest = await loadSuite.group.entries.single.load(loadSuite);
156 expect(liveTest.onPrint.first, completion(equals("print within test"))); 156 expect(liveTest.onMessage.first.then((message) => message.text),
157 completion(equals("print within test")));
157 await liveTest.run(); 158 await liveTest.run();
158 expectTestPassed(liveTest); 159 expectTestPassed(liveTest);
159 }); 160 });
160 161
161 // TODO: Test load suites. Don't forget to test that prints in loaded files 162 // TODO: Test load suites. Don't forget to test that prints in loaded files
162 // are piped through the suite. Also for browser tests! 163 // are piped through the suite. Also for browser tests!
163 } 164 }
OLDNEW
« no previous file with comments | « test/runner/json_reporter_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine