blob: 69859675237e05045f62bf97c4f6f36edb66dee6 [file] [log] [blame]
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter_tools/src/base/io.dart';
// This application will log to STDOUT and exit with 0 when it receives the
// SIGTERM signal.
Future<void> main() async {
final Stdout stdout = Stdio().stdout;
final Stream<ProcessSignal> interruptStream =;
interruptStream.listen((_) {
// The test should assert that this was logged
stdout.writeln('Successfully received SIGTERM!');
// The test should wait for this message before sending SIGTERM, or else the
// listener may not have been registered.
stdout.writeln('Ready to receive signals');
await Future<void>.delayed(const Duration(seconds: 10));
stdout.writeln('Did not receive SIGTERM!');