OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library pub_tests; | |
6 | |
7 import 'package:path/path.dart' as p; | |
8 import 'package:scheduled_test/scheduled_test.dart'; | |
9 import 'package:scheduled_test/scheduled_stream.dart'; | |
10 | |
11 import '../descriptor.dart' as d; | |
12 import '../test_pub.dart'; | |
13 | |
14 main() { | |
15 initConfig(); | |
16 integration("creates a snapshot for an immediate dependency's executables", | |
17 () { | |
18 servePackages((builder) { | |
19 builder.serve("foo", "5.6.7", contents: [ | |
20 d.dir("bin", [d.file("hello.dart", "void main() => print('hello!');")]) | |
21 ]); | |
22 }); | |
23 | |
24 d.appDir({"foo": "5.6.7"}).create(); | |
25 | |
26 pubGet(output: contains("Precompiled foo:hello.")); | |
27 | |
28 d.dir(p.join(appPath, '.pub', 'bin'), [ | |
29 d.dir('foo', [d.outOfDateSnapshot('hello.dart.snapshot')]) | |
30 ]).create(); | |
31 | |
32 var process = pubRun(args: ['foo:hello']); | |
33 | |
34 // In the real world this would just print "hello!", but since we collect | |
35 // all output we see the precompilation messages as well. | |
36 process.stdout.expect("Precompiling executables..."); | |
37 process.stdout.expect(consumeThrough("hello!")); | |
38 process.shouldExit(); | |
39 | |
40 d.dir(p.join(appPath, '.pub', 'bin'), [ | |
41 d.file('sdk-version', '0.1.2+3'), | |
42 d.dir('foo', [d.matcherFile('hello.dart.snapshot', contains('hello!'))]) | |
43 ]).create(); | |
44 }); | |
45 } | |
OLD | NEW |