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 import 'dart:math' as math; | 8 import 'dart:math' as math; |
9 | 9 |
10 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 import 'package:test/test.dart'; | 32 import 'package:test/test.dart'; |
33 | 33 |
34 void main() { | 34 void main() { |
35 test("failure", () => throw new TestFailure("oh no")); | 35 test("failure", () => throw new TestFailure("oh no")); |
36 } | 36 } |
37 """; | 37 """; |
38 | 38 |
39 final _defaultConcurrency = math.max(1, Platform.numberOfProcessors ~/ 2); | 39 final _defaultConcurrency = math.max(1, Platform.numberOfProcessors ~/ 2); |
40 | 40 |
| 41 final _browsers = |
| 42 "[vm (default), dartium, content-shell, chrome, phantomjs, firefox" + |
| 43 (Platform.isMacOS ? ", safari" : "") + "]"; |
| 44 |
41 final _usage = """ | 45 final _usage = """ |
42 Usage: pub run test:test [files or directories...] | 46 Usage: pub run test:test [files or directories...] |
43 | 47 |
44 -h, --help Shows this usage information. | 48 -h, --help Shows this usage information. |
45 --version Shows the package's version. | 49 --version Shows the package's version. |
46 -n, --name A substring of the name of the test to run. | 50 -n, --name A substring of the name of the test to run. |
47 Regular expression syntax is supported. | 51 Regular expression syntax is supported. |
48 | 52 |
49 -N, --plain-name A plain-text substring of the name of the test to
run. | 53 -N, --plain-name A plain-text substring of the name of the test to
run. |
50 -p, --platform The platform(s) on which to run the tests. | 54 -p, --platform The platform(s) on which to run the tests. |
51 [vm (default), dartium, content-shell, chrome, ph
antomjs, firefox, safari] | 55 $_browsers |
52 | 56 |
53 -j, --concurrency=<threads> The number of concurrent test suites run. | 57 -j, --concurrency=<threads> The number of concurrent test suites run. |
54 (defaults to $_defaultConcurrency) | 58 (defaults to $_defaultConcurrency) |
55 | 59 |
56 --pub-serve=<port> The port of a pub serve instance serving "test/". | 60 --pub-serve=<port> The port of a pub serve instance serving "test/". |
57 --[no-]color Whether to use terminal colors. | 61 --[no-]color Whether to use terminal colors. |
58 (auto-detected by default) | 62 (auto-detected by default) |
59 """; | 63 """; |
60 | 64 |
61 void main() { | 65 void main() { |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 }); | 462 }); |
459 }); | 463 }); |
460 }); | 464 }); |
461 } | 465 } |
462 | 466 |
463 ProcessResult _runUnittest(List<String> args) => | 467 ProcessResult _runUnittest(List<String> args) => |
464 runUnittest(args, workingDirectory: _sandbox); | 468 runUnittest(args, workingDirectory: _sandbox); |
465 | 469 |
466 ProcessResult _runDart(List<String> args) => | 470 ProcessResult _runDart(List<String> args) => |
467 runDart(args, workingDirectory: _sandbox); | 471 runDart(args, workingDirectory: _sandbox); |
OLD | NEW |