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