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 | 8 |
9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
10 import 'package:test/src/util/exit_codes.dart' as exit_codes; | 10 import 'package:test/src/util/exit_codes.dart' as exit_codes; |
(...skipping 19 matching lines...) Expand all Loading... |
30 import 'package:test/test.dart'; | 30 import 'package:test/test.dart'; |
31 | 31 |
32 void main() { | 32 void main() { |
33 test("failure", () => throw new TestFailure("oh no")); | 33 test("failure", () => throw new TestFailure("oh no")); |
34 } | 34 } |
35 """; | 35 """; |
36 | 36 |
37 final _usage = """ | 37 final _usage = """ |
38 Usage: pub run test:test [files or directories...] | 38 Usage: pub run test:test [files or directories...] |
39 | 39 |
40 -h, --help Shows this usage information. | 40 -h, --help Shows this usage information. |
41 -n, --name A substring of the name of the test to run. | 41 -n, --name A substring of the name of the test to run. |
42 Regular expression syntax is supported. | 42 Regular expression syntax is supported. |
43 | 43 |
44 -N, --plain-name A plain-text substring of the name of the test to run. | 44 -N, --plain-name A plain-text substring of the name of the test to run. |
45 -p, --platform The platform(s) on which to run the tests. | 45 -p, --platform The platform(s) on which to run the tests. |
46 [vm (default), chrome] | 46 [vm (default), chrome] |
47 | 47 |
48 --[no-]color Whether to use terminal colors. | 48 --pub-serve=<port> The port of a pub serve instance serving "test/". |
49 (auto-detected by default) | 49 --[no-]color Whether to use terminal colors. |
| 50 (auto-detected by default) |
50 """; | 51 """; |
51 | 52 |
52 void main() { | 53 void main() { |
53 setUp(() { | 54 setUp(() { |
54 _sandbox = Directory.systemTemp.createTempSync('test_').path; | 55 _sandbox = Directory.systemTemp.createTempSync('test_').path; |
55 }); | 56 }); |
56 | 57 |
57 tearDown(() { | 58 tearDown(() { |
58 new Directory(_sandbox).deleteSync(recursive: true); | 59 new Directory(_sandbox).deleteSync(recursive: true); |
59 }); | 60 }); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 }); | 371 }); |
371 }); | 372 }); |
372 }); | 373 }); |
373 } | 374 } |
374 | 375 |
375 ProcessResult _runUnittest(List<String> args) => | 376 ProcessResult _runUnittest(List<String> args) => |
376 runUnittest(args, workingDirectory: _sandbox); | 377 runUnittest(args, workingDirectory: _sandbox); |
377 | 378 |
378 ProcessResult _runDart(List<String> args) => | 379 ProcessResult _runDart(List<String> args) => |
379 runDart(args, workingDirectory: _sandbox); | 380 runDart(args, workingDirectory: _sandbox); |
OLD | NEW |