Fix opttest script

This commit is contained in:
Lorenz Kästle 2025-02-19 19:43:40 +01:00
parent cb5abf1981
commit b982e12ecf

View file

@ -28,22 +28,41 @@ for my $prog (keys %progs) {
$idx = 1;
$output = `$prog -h 2>&1`;
if($?) {$state++;print "$prog failed test $idx\n";}
if(($? >> 8) != 3) {
$state++;
print "$prog failed test $idx (help exit code (short form))\n";
exit(1);
}
unless ($output =~ m/$progs{$prog}/ms) {
$idx++; $state++;print "$output\n$prog failed test $idx\n";
$idx++;
$state++;
print "$output\n$prog failed test $idx\n";
}
$idx++;
`$prog --help 2>&1 > /dev/null`;
if($?) {$state++;print "$prog failed test $idx\n";}
if(($? >> 8) != 3) {
$state++;
print "$prog failed test $idx (help exit code (long form))\n";
exit(1);
}
$idx++;
`$prog -V 2>&1 > /dev/null`;
if($?) {$state++;print "$prog failed test $idx\n";}
`$prog -V 2>&1 > /dev/null`;
if(($? >> 8) != 3) {
$state++;
print "$prog failed test $idx (version exit code (short form))\n";
exit(1);
}
$idx++;
`$prog --version 2>&1 > /dev/null`;
if($?) {$state++;print "$prog failed test $idx\n";}
if(($? >> 8) != 3) {
$state++;
print "$prog failed test $idx (version exit code (long form))\n";
exit(1);
}
print "$prog ($idx tests) ";
ok $state,0;