| Index: tests/standalone/io/signals_test.dart
|
| diff --git a/tests/standalone/io/signals_test.dart b/tests/standalone/io/signals_test.dart
|
| index d73b01ac256c1507ea89eb5a226c84b59e720ab2..a8112088df187ac07011a1afb8a6970f6e66224c 100644
|
| --- a/tests/standalone/io/signals_test.dart
|
| +++ b/tests/standalone/io/signals_test.dart
|
| @@ -60,7 +60,7 @@ void testSignal(ProcessSignal signal) {
|
| process.kill(signal);
|
| }
|
| }, onDone: () {
|
| - Expect.equals('ready\ngot signal\n', output);
|
| + Expect.equals('ready\n$signal\n', output);
|
| });
|
| process.exitCode.then((exitCode) {
|
| Expect.equals(0, exitCode);
|
| @@ -69,6 +69,34 @@ void testSignal(ProcessSignal signal) {
|
| });
|
| }
|
|
|
| +void testMultipleSignals(List<ProcessSignal> signals) {
|
| + for (var signal in signals) {
|
| + asyncStart();
|
| + Process.start(Platform.executable,
|
| + [Platform.script.resolve('signal_test_script.dart').toFilePath()]
|
| + ..addAll(signals.map((s) => s.toString())))
|
| + .then((process) {
|
| + process.stdin.close();
|
| + process.stderr.drain();
|
| +
|
| + var output = "";
|
| + process.stdout.transform(UTF8.decoder)
|
| + .listen((str) {
|
| + output += str;
|
| + if (output == 'ready\n') {
|
| + process.kill(signal);
|
| + }
|
| + }, onDone: () {
|
| + Expect.equals('ready\n$signal\n', output);
|
| + });
|
| + process.exitCode.then((exitCode) {
|
| + Expect.equals(0, exitCode);
|
| + asyncEnd();
|
| + });
|
| + });
|
| + }
|
| +}
|
| +
|
|
|
| void testListenCancel() {
|
| for (int i = 0; i < 10; i++) {
|
| @@ -95,4 +123,12 @@ void main() {
|
| testSignal(ProcessSignal.SIGUSR1);
|
| testSignal(ProcessSignal.SIGUSR2);
|
| testSignal(ProcessSignal.SIGWINCH);
|
| +
|
| + testMultipleSignals([
|
| + ProcessSignal.SIGHUP,
|
| + ProcessSignal.SIGINT,
|
| + ProcessSignal.SIGTERM,
|
| + ProcessSignal.SIGUSR1,
|
| + ProcessSignal.SIGUSR2,
|
| + ProcessSignal.SIGWINCH]);
|
| }
|
|
|