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 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import '../descriptor.dart' as d; | 7 import '../descriptor.dart' as d; |
8 import '../test_pub.dart'; | 8 import '../test_pub.dart'; |
9 | 9 |
10 const _catchableSignals = const [ | 10 const _catchableSignals = const [ |
(...skipping 12 matching lines...) Expand all Loading... |
23 ProcessSignal.SIGTERM.watch().first.then(print); | 23 ProcessSignal.SIGTERM.watch().first.then(print); |
24 ProcessSignal.SIGUSR1.watch().first.then(print); | 24 ProcessSignal.SIGUSR1.watch().first.then(print); |
25 ProcessSignal.SIGUSR2.watch().first.then(print); | 25 ProcessSignal.SIGUSR2.watch().first.then(print); |
26 ProcessSignal.SIGWINCH.watch().first.then(print); | 26 ProcessSignal.SIGWINCH.watch().first.then(print); |
27 | 27 |
28 print("ready"); | 28 print("ready"); |
29 } | 29 } |
30 """; | 30 """; |
31 | 31 |
32 main() { | 32 main() { |
33 initConfig(); | |
34 integration('forwards signals to the inner script', () { | 33 integration('forwards signals to the inner script', () { |
35 d.dir(appPath, [ | 34 d.dir(appPath, [ |
36 d.appPubspec(), | 35 d.appPubspec(), |
37 d.dir("bin", [ | 36 d.dir("bin", [ |
38 d.file("script.dart", SCRIPT) | 37 d.file("script.dart", SCRIPT) |
39 ]) | 38 ]) |
40 ]).create(); | 39 ]).create(); |
41 | 40 |
42 var pub = pubRun(args: ["bin/script"]); | 41 var pub = pubRun(args: ["bin/script"]); |
43 | 42 |
44 pub.stdout.expect("ready"); | 43 pub.stdout.expect("ready"); |
45 for (var signal in _catchableSignals) { | 44 for (var signal in _catchableSignals) { |
46 pub.signal(signal); | 45 pub.signal(signal); |
47 pub.stdout.expect(signal.toString()); | 46 pub.stdout.expect(signal.toString()); |
48 } | 47 } |
49 | 48 |
50 pub.kill(); | 49 pub.kill(); |
51 }); | 50 }); |
52 } | 51 } |
OLD | NEW |