@@ -19,6 +19,10 @@ import 'package:pub/src/dart.dart';
1919import 'package:pub/src/exceptions.dart' ;
2020
2121Future <void > main (List <String > args) async {
22+ Process testProcess;
23+ ProcessSignal .sigint.watch ().listen ((signal) {
24+ testProcess? .kill (signal);
25+ });
2226 final pubSnapshotFilename =
2327 path.absolute (path.join ('.dart_tool' , '_pub' , 'pub.dart.snapshot.dart2' ));
2428 final pubSnapshotIncrementalFilename = '$pubSnapshotFilename .incremental' ;
@@ -30,17 +34,15 @@ Future<void> main(List<String> args) async {
3034 incrementalDillOutputPath: pubSnapshotIncrementalFilename,
3135 name: 'bin/pub.dart' ,
3236 packageConfigPath: path.join ('.dart_tool' , 'package_config.json' ));
33- final extension = Platform .isWindows ? '.bat' : '' ;
34- final testProcess = await Process .start (
35- path.join (path.dirname (Platform .resolvedExecutable), 'pub$extension ' ),
36- ['run' , 'test' , ...args],
37- environment: {'_PUB_TEST_SNAPSHOT' : pubSnapshotFilename});
38- await Future .wait ([
39- testProcess.stdout.pipe (stdout),
40- testProcess.stderr.pipe (stderr),
41- ]);
37+ testProcess = await Process .start (
38+ Platform .resolvedExecutable,
39+ ['run' , 'test' , '--chain-stack-traces' , ...args],
40+ environment: {'_PUB_TEST_SNAPSHOT' : pubSnapshotFilename},
41+ mode: ProcessStartMode .inheritStdio,
42+ );
4243 exitCode = await testProcess.exitCode;
43- } on ApplicationException catch (_) {
44+ } on ApplicationException catch (e) {
45+ print ('Failed building snapshot: $e ' );
4446 exitCode = 1 ;
4547 } finally {
4648 try {
0 commit comments