Skip crc32 test if 'cksum' is not present for comparison (e.g. SkyOS)

This commit is contained in:
Brian Cox 2017-09-03 00:12:54 -07:00
parent 736a761bff
commit 0d21e71407
1 changed files with 29 additions and 22 deletions

View File

@ -28,39 +28,46 @@ sub initialize() {
# #
sub run() { sub run() {
my $twpassed = 1; my $twpassed = 1;
twtools::logStatus("*** Beginning $description\n"); twtools::logStatus("*** Beginning $description\n");
printf("%-30s", "-- $description"); printf("%-30s", "-- $description");
# lets see if the system 'cksum' agree's with siggen's crc32 value # lets see if the system 'cksum' agree's with siggen's crc32 value
# #
my ($crc32, undef) = split(/ /, `cksum $twtools::twrootdir/test`); my ($crc32, undef) = split(/ /, `cksum $twtools::twrootdir/test`);
my $siggen = `$twtools::twrootdir/bin/siggen -h -t -C $twtools::twrootdir/test`;
chomp $crc32; if ($crc32 eq "") {
chomp $siggen; ++$twtools::twskippedtests;
print "SKIPPED\n";
return;
}
# cksum issues results in decimal, so get siggen's result in base10. my $siggen = `$twtools::twrootdir/bin/siggen -h -t -C $twtools::twrootdir/test`;
$siggen = hex($siggen);
twtools::logStatus(" cksum reports: $crc32\n"); chomp $crc32;
twtools::logStatus("siggen reports: $siggen\n"); chomp $siggen;
$twpassed = ($crc32 eq $siggen); # cksum issues results in decimal, so get siggen's result in base10.
$siggen = hex($siggen);
######################################################### twtools::logStatus(" cksum reports: $crc32\n");
# twtools::logStatus("siggen reports: $siggen\n");
# See if the tests all succeeded...
# $twpassed = ($crc32 eq $siggen);
if ($twpassed) {
#########################################################
#
# See if the tests all succeeded...
#
if ($twpassed) {
print "PASSED\n"; print "PASSED\n";
++$twtools::twpassedtests; ++$twtools::twpassedtests;
} }
else { else {
++$twtools::twfailedtests; ++$twtools::twfailedtests;
print "*FAILED*\n"; print "*FAILED*\n";
} }
} }