commit f12acb7
shrub
·
2026-04-12 12:41:53 +0000 UTC
parent 3997951
make test printouts slighly prettier
1 files changed,
+6,
-2
+6,
-2
1@@ -242,7 +242,7 @@ sub create_command {
2 sub run_make_with_options {
3 my ($filename, $options, $logname, $expected_code, $timeout, @call) = @_;
4 @call = caller unless @call;
5- my $code;
6+ my ($code, $testid);
7 my $command = create_command($options);
8
9 $expected_code = 0 unless defined($expected_code);
10@@ -296,6 +296,10 @@ sub run_make_with_options {
11
12 my $cmdstr = cmd2str($command);
13 $command_string = "# $call[1]:$call[2]:\n$cmdstr\n";
14+ $testid = $filename // '';
15+ $testid =~ s!.*/!!;
16+ $testid =~ s!\.[^.]+$!!;
17+ $testid = 'unknown' if !$testid;
18
19 if ($valgrind) {
20 print VALGRIND "\n\nExecuting: $cmdstr\n";
21@@ -334,7 +338,7 @@ sub run_make_with_options {
22 }
23
24 if ($code != $expected_code) {
25- print "Error running @make_command (expected $expected_code; got $code)\n$call[1]:$call[2]: $cmdstr\n";
26+ print " $testid: exit $code, expected $expected_code [$call[1]:$call[2]]\n";
27 $test_passed = 0;
28 &create_file(get_runfile(), $command_string);
29 # If it's a SIGINT, stop here