Fix makeTestfile.pl to report test failures properly

If a test program reports test failures, the Perl wrapper
must return the same error status. On Windows where we use
system() instead of exec() that needs some value fiddling.
This commit is contained in:
Andrew Johnson
2020-12-18 10:20:31 -06:00
parent 48a6d2f781
commit 68c056f2f8
+4 -2
View File
@@ -36,8 +36,10 @@ use Cwd 'abs_path';
if (\$^O eq 'MSWin32') {
# Use system on Windows, exec doesn't work the same there and
# GNUmake thinks the test has finished as soon as Perl exits.
system('./$exe') == 0 or die "Can't run $exe: \$!\\n";
# GNUmake thinks the test has finished too soon.
my \$status = system('./$exe');
die "Can't run $exe: \$!\\n" if \$status == -1;
exit \$status >> 8;
}
else {
exec './$exe' or die "Can't run $exe: \$!\\n";