@@ -19,6 +19,10 @@ import 'package:pub/src/dart.dart';
19
19
import 'package:pub/src/exceptions.dart' ;
20
20
21
21
Future <void > main (List <String > args) async {
22
+ Process testProcess;
23
+ ProcessSignal .sigint.watch ().listen ((signal) {
24
+ testProcess? .kill (signal);
25
+ });
22
26
final pubSnapshotFilename =
23
27
path.absolute (path.join ('.dart_tool' , '_pub' , 'pub.dart.snapshot.dart2' ));
24
28
final pubSnapshotIncrementalFilename = '$pubSnapshotFilename .incremental' ;
@@ -30,17 +34,15 @@ Future<void> main(List<String> args) async {
30
34
incrementalDillOutputPath: pubSnapshotIncrementalFilename,
31
35
name: 'bin/pub.dart' ,
32
36
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
+ );
42
43
exitCode = await testProcess.exitCode;
43
- } on ApplicationException catch (_) {
44
+ } on ApplicationException catch (e) {
45
+ print ('Failed building snapshot: $e ' );
44
46
exitCode = 1 ;
45
47
} finally {
46
48
try {
0 commit comments