4 $join = '/usr/bin/join';
9 print ":\n$join --version\nerrors=0\n";
17 next if (/^\s*#/ || /^\s+$/);
21 $prog = '($test_name, $flags,$f1,$f2,$expected,$e_ret_code) = ' . $_ . ';';
23 if (defined ($seen{$test_name}))
25 die "$0: $.: duplicate test name \`$test_name'\n";
27 $seen{$test_name} = 1;
28 $in1 = "t$test_name.1";
29 $in2 = "t$test_name.2";
30 $log = "t$test_name.log";
31 $exp_name = 't' . $test_name . '.exp';
32 $out = "t$test_name.out";
34 open(IN
, ">$in1") || die "Couldn't open $in1 for writing.\n";
37 open(IN
, ">$in2") || die "Couldn't open $in2 for writing.\n";
40 open(EXP
, ">$exp_name")
41 || die "Couldn't open $exp_name for writing.\n";
44 $cmd = "$join $flags $in1 $in2 > $out";
49 if test \$code != $e_ret_code ; then
50 err_msg="Test $test_name failed: join return code \$code differs from expected value $e_ret_code"
52 cmp $out $exp_name >> $log 2>&1
55 if test "\$verbose" ; then
56 echo passed $test_name
60 1) err_msg="Test $test_name failed: files $out and $exp_name differ"
62 2) err_msg="Test $test_name may have failed.
63 echo The command \"cmp $out $exp_name\" failed."
67 if test \$fail = yes; then
68 errors=`expr \$errors + 1`
69 echo "Failing command: $cmd" >> $log
70 echo "\$err_msg" >> $log
72 test -s $log || rm -f $log
76 if test \$errors -gt 0 ; then
77 echo "Failed \$errors tests." 1>&2
79 echo 'Passed all tests.' 1>&2