8 use OpenSSL::Test qw/:DEFAULT srctop_file/;
14 require_ok(srctop_file("test","recipes","bc.pl"));
16 my $testresults = "tmp.bntest";
17 my $init = ok(run(test(["bntest"], stdout => $testresults)), 'initialize');
20 skip "Initializing failed, skipping", 1 if !$init;
22 subtest 'Checking the bn results' => sub {
24 if (open DATA, $testresults) {
28 map { s/\R//; } @lines; # chomp(@lines);
30 plan tests => scalar grep(/^print /, @lines);
34 while (scalar @lines) {
37 last if $l =~ /^print /;
47 while (scalar @lines) {
50 last if $l =~ /^print /;
55 ok(check_operations(@operations), "verify $t");
62 sub check_operations {
65 foreach my $line (@_) {
66 my $result = calc(split /\s+/, $line);
68 if ($result ne "0" && $result ne "0x0") {
70 print STDERR "Failed! $line => $result\n";
74 return $failcount == 0;