Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
Always call pub.bat on windows. (#49)
Browse files Browse the repository at this point in the history
* Always call  on windows.

* Update pubspec.
  • Loading branch information
matanlurey authored Mar 30, 2017
1 parent dc29a9a commit ed125a4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0-beta+1

- Properly fix support for windows by using `pub.bat`.

## 1.0.0-beta

- Prepare to support `angular2: 3.0.0-beta`.
Expand Down
56 changes: 31 additions & 25 deletions bin/angular_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,19 @@ main(List<String> args) async {
});
}

Future<int> _runTests(
{List<String> includeFlags: const ['aot'],
List<String> includePlatforms: const ['content-shell'],
List<String> testNames,
List<String> testPlainNames}) async {
Future<int> _runTests({
List<String> includeFlags: const ['aot'],
List<String> includePlatforms: const ['content-shell'],
List<String> testNames,
List<String> testPlainNames,
}) async {
final args = ['run', 'test', '--pub-serve=8080'];
args.addAll(includeFlags.map((f) => '-t $f'));
if (testNames != null) args.addAll(testNames.map((n) => '--name=$n'));
if (testPlainNames != null)
args.addAll(testPlainNames.map((n) => '--plain-name=$n'));
args.add('--platform=${includePlatforms.map((p) => p.trim()).join(' ')}');
final process = await Process.start('pub', args);
final process = await Process.start(_pubBin, args);
await Future.wait([
process.stderr.map(UTF8.decode).forEach(error),
process.stdout.map(UTF8.decode).forEach(log),
Expand Down Expand Up @@ -116,25 +117,30 @@ final _argParser = new ArgParser()
abbr: 'p',
help: 'What platform(s) to pass to pub run test',
valueHelp: 'Common examples are "content-shell", "dartium", "chrome"',
// TODO: Detect if content-shell is installed, fall back otherwise.
defaultsTo: 'content-shell',
allowMultiple: true,
)
..addOption('name',
abbr: 'n',
help: 'A substring of the name of the test to run.\n'
'Regular expression syntax is supported.\n'
'If passed multiple times, tests must match all substrings.',
allowMultiple: true,
splitCommas: false)
..addOption('plain-name',
abbr: 'N',
help: 'A plain-text substring of the name of the test to run.\n'
'If passed multiple times, tests must match all substrings.',
allowMultiple: true,
splitCommas: false)
..addFlag('verbose',
abbr: 'v',
help: 'Whether to display pub serve output as well when running tests.\n'
'Defaults to false.',
defaultsTo: false);
..addOption(
'name',
abbr: 'n',
help: 'A substring of the name of the test to run.\n'
'Regular expression syntax is supported.\n'
'If passed multiple times, tests must match all substrings.',
allowMultiple: true,
splitCommas: false,
)
..addOption(
'plain-name',
abbr: 'N',
help: 'A plain-text substring of the name of the test to run.\n'
'If passed multiple times, tests must match all substrings.',
allowMultiple: true,
splitCommas: false,
)
..addFlag(
'verbose',
abbr: 'v',
help: 'Whether to display pub serve output as well when running tests.\n'
'Defaults to false.',
defaultsTo: false,
);
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: angular_test
author: Dart Team <[email protected]>
homepage: https://github.com/dart-lang/angular_test
description: Testing infrastructure for AngularDart
version: 1.0.0-beta
version: 1.0.0-beta+1

environment:
sdk: '>=1.22.0 <2.0.0'
Expand Down

0 comments on commit ed125a4

Please sign in to comment.