OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
8 import 'package:scheduled_test/scheduled_process.dart'; | 8 import 'package:scheduled_test/scheduled_process.dart'; |
9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
10 | 10 |
11 import '../../descriptor.dart' as d; | 11 import '../../descriptor.dart' as d; |
12 import '../../test_pub.dart'; | 12 import '../../test_pub.dart'; |
13 import 'utils.dart'; | 13 import 'utils.dart'; |
14 | 14 |
15 main() { | 15 main() { |
16 initConfig(); | |
17 integration("the generated binstub runs a snapshotted executable", () { | 16 integration("the generated binstub runs a snapshotted executable", () { |
18 servePackages((builder) { | 17 servePackages((builder) { |
19 builder.serve("foo", "1.0.0", pubspec: { | 18 builder.serve("foo", "1.0.0", pubspec: { |
20 "executables": { | 19 "executables": { |
21 "foo-script": "script" | 20 "foo-script": "script" |
22 } | 21 } |
23 }, contents: [ | 22 }, contents: [ |
24 d.dir("bin", [ | 23 d.dir("bin", [ |
25 d.file("script.dart", "main(args) => print('ok \$args');") | 24 d.file("script.dart", "main(args) => print('ok \$args');") |
26 ]) | 25 ]) |
(...skipping 28 matching lines...) Expand all Loading... |
55 | 54 |
56 var process = new ScheduledProcess.start( | 55 var process = new ScheduledProcess.start( |
57 p.join(sandboxDir, cachePath, "bin", binStubName("foo-script")), | 56 p.join(sandboxDir, cachePath, "bin", binStubName("foo-script")), |
58 ["arg1", "arg2"], | 57 ["arg1", "arg2"], |
59 environment: getEnvironment()); | 58 environment: getEnvironment()); |
60 | 59 |
61 process.stdout.expect("ok [arg1, arg2]"); | 60 process.stdout.expect("ok [arg1, arg2]"); |
62 process.shouldExit(); | 61 process.shouldExit(); |
63 }); | 62 }); |
64 } | 63 } |
OLD | NEW |