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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user