]> git.ozlabs.org Git - ponghero.git/blob - ccan/ccan_tools/libtap/tests/test.t
Prepare for release: rename to ponghero and pull in ccan.
[ponghero.git] / ccan / ccan_tools / libtap / tests / test.t
1 #!/bin/sh
2
3 echo '1..2'
4
5 make 2>&1 > /dev/null || exit 1
6
7 # Comment this out if you care about exact formatting
8 rationalize()
9 {
10     tr -s ' ' | sed -e 's/ tests / test /' -e "s/ test '[^']*'/ test ()/" -e "s/ test (.*)/ test ()/" -e 's, Second plan at \./test.pl line.*,,' -e 's,Failed test in ./test.pl at line .*,Failed test (),'
11 }
12
13 perl ./test.pl 2>&1 | rationalize | grep -v '^# \+in ./test.pl at line'> test.pl.out
14 perlstatus=$?
15
16 ./test 2>&1 | rationalize > test.c.out
17 cstatus=$?
18
19 ret=0
20 diff -u test.pl.out test.c.out
21
22 if [ $? -eq 0 ]; then
23         echo 'ok 1 - output is identical'
24 else
25         echo 'not ok 1 - output is identical'
26         ret=1
27 fi
28
29 if [ $perlstatus -eq $cstatus ]; then
30         echo 'ok 2 - status code'
31 else
32         echo 'not ok 2 - status code'
33         echo "# perlstatus = $perlstatus"
34         echo "#    cstatus = $cstatus"
35         ret=1
36 fi
37
38 exit $ret