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

Unified Diff: bin/unittest.dart

Issue 983573002: Add support for running browser tests to the test runner. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/backend/suite.dart » ('j') | lib/src/runner/reporter/no_io_compact.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/unittest.dart
diff --git a/bin/unittest.dart b/bin/unittest.dart
index b2d70acc0eb50da774b2c1d2f91ab0c4d2f625ad..53cfcde65c72ed1620efd288366ab1e2bc3b636a 100644
--- a/bin/unittest.dart
+++ b/bin/unittest.dart
@@ -12,6 +12,7 @@ import 'package:args/args.dart';
import 'package:stack_trace/stack_trace.dart';
import 'package:unittest/src/runner/reporter/compact.dart';
+import 'package:unittest/src/runner/test_platform.dart';
import 'package:unittest/src/runner/load_exception.dart';
import 'package:unittest/src/runner/loader.dart';
import 'package:unittest/src/util/exit_codes.dart' as exit_codes;
@@ -19,12 +20,18 @@ import 'package:unittest/src/util/io.dart';
import 'package:unittest/src/utils.dart';
/// The argument parser used to parse the executable arguments.
-final _parser = new ArgParser();
+final _parser = new ArgParser(allowTrailingOptions: true);
void main(List<String> args) {
_parser.addFlag("help", abbr: "h", negatable: false,
help: "Shows this usage information.");
_parser.addOption("package-root", hide: true);
+ _parser.addOption("platform",
+ abbr: 'p',
+ help: 'The platform(s) on which to run the tests.',
+ allowed: TestPlatform.all.map((platform) => platform.identifier).toList(),
+ defaultsTo: 'vm',
+ allowMultiple: true);
_parser.addFlag("color", defaultsTo: null,
help: 'Whether to use terminal colors.\n(auto-detected by default)');
@@ -42,7 +49,12 @@ void main(List<String> args) {
return;
}
- var loader = new Loader(packageRoot: options["package-root"]);
+ var color = options["color"];
+ if (color == null) color = canUseSpecialChars;
+
+ var platforms = options["platform"].map(TestPlatform.find);
+ var loader = new Loader(platforms,
+ packageRoot: options["package-root"], color: color);
new Future.sync(() {
var paths = options.rest;
if (paths.isEmpty) {
@@ -60,8 +72,6 @@ void main(List<String> args) {
throw new LoadException(path, 'Does not exist.');
}));
}).then((suites) {
- var color = options["color"];
- if (color == null) color = canUseSpecialChars;
var reporter = new CompactReporter(flatten(suites), color: color);
return reporter.run().then((success) {
exitCode = success ? 0 : 1;
« no previous file with comments | « no previous file | lib/src/backend/suite.dart » ('j') | lib/src/runner/reporter/no_io_compact.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698