9 use OpenSSL::Test qw/:DEFAULT top_file/;
15 require_ok(top_file("test","recipes","bc.pl"));
17 my $testresults = "tmp.bntest";
18 my $init = ok(run(test(["bntest"], stdout => $testresults)), 'initialize');
21 skip "Initializing failed, skipping", 1 if !$init;
23 subtest 'Checking the bn results' => sub {
25 if (open DATA, $testresults) {
31 plan tests => scalar grep(/^print /, @lines);
35 while (scalar @lines) {
38 last if $l =~ /^print /;
48 while (scalar @lines) {
51 last if $l =~ /^print /;
56 ok(check_operations(@operations), "verify $t");
63 sub check_operations {
66 foreach my $line (@_) {
67 my $result = calc(split /\s+/, $line);
69 if ($result ne "0" && $result ne "0x0") {
71 print STDERR "Failed! $line => $result\n";
75 return $failcount == 0;