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

Side by Side Diff: lib/test.dart

Issue 1239693002: Pass actual TestPlatform and OperatingSystem values to Suite. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Update pubspec. Created 5 years, 5 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
« no previous file with comments | « lib/src/runner/vm/isolate_test.dart ('k') | pubspec.yaml » ('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 test; 5 library test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:path/path.dart' as p; 9 import 'package:path/path.dart' as p;
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 var declarer = Zone.current[#test.declarer]; 43 var declarer = Zone.current[#test.declarer];
44 if (declarer != null) return declarer; 44 if (declarer != null) return declarer;
45 if (_globalDeclarer != null) return _globalDeclarer; 45 if (_globalDeclarer != null) return _globalDeclarer;
46 46
47 // Since there's no Zone-scoped declarer, the test file is being run directly. 47 // Since there's no Zone-scoped declarer, the test file is being run directly.
48 // In order to run the tests, we set up our own Declarer via 48 // In order to run the tests, we set up our own Declarer via
49 // [_globalDeclarer], and schedule a microtask to run the tests once they're 49 // [_globalDeclarer], and schedule a microtask to run the tests once they're
50 // finished being defined. 50 // finished being defined.
51 _globalDeclarer = new Declarer(); 51 _globalDeclarer = new Declarer();
52 scheduleMicrotask(() async { 52 scheduleMicrotask(() async {
53 var suite = 53 var suite = new Suite(
54 new Suite(_globalDeclarer.tests, 54 _globalDeclarer.tests,
55 path: p.prettyUri(Uri.base), 55 path: p.prettyUri(Uri.base),
56 platform: "VM") 56 platform: TestPlatform.vm,
57 .forPlatform(TestPlatform.vm, os: currentOSGuess); 57 os: currentOSGuess);
58 58
59 var engine = new Engine(); 59 var engine = new Engine();
60 engine.suiteSink.add(suite); 60 engine.suiteSink.add(suite);
61 engine.suiteSink.close(); 61 engine.suiteSink.close();
62 ExpandedReporter.watch(engine, 62 ExpandedReporter.watch(engine,
63 color: true, printPath: false, printPlatform: false); 63 color: true, printPath: false, printPlatform: false);
64 64
65 var success = await engine.run(); 65 var success = await engine.run();
66 // TODO(nweiz): Set the exit code on the VM when issue 6943 is fixed. 66 // TODO(nweiz): Set the exit code on the VM when issue 6943 is fixed.
67 if (success) return; 67 if (success) return;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 /// group. [callback] will be run before any tear-down callbacks in parent 176 /// group. [callback] will be run before any tear-down callbacks in parent
177 /// groups or at the top level. 177 /// groups or at the top level.
178 void tearDown(callback()) => _declarer.tearDown(callback); 178 void tearDown(callback()) => _declarer.tearDown(callback);
179 179
180 /// Registers an exception that was caught for the current test. 180 /// Registers an exception that was caught for the current test.
181 void registerException(error, [StackTrace stackTrace]) { 181 void registerException(error, [StackTrace stackTrace]) {
182 // This will usually forward directly to [Invoker.current.handleError], but 182 // This will usually forward directly to [Invoker.current.handleError], but
183 // going through the zone API allows other zones to consistently see errors. 183 // going through the zone API allows other zones to consistently see errors.
184 Zone.current.handleUncaughtError(error, stackTrace); 184 Zone.current.handleUncaughtError(error, stackTrace);
185 } 185 }
OLDNEW
« no previous file with comments | « lib/src/runner/vm/isolate_test.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698