12c5b204 |
1 | #!/bin/sh |
2 | # usage: r1test <testcasename> |
3 | |
4 | set -e |
39196d5f |
5 | casename="$1" |
6 | case="case-$casename" |
98b6d5b4 |
7 | ocase="output-$casename" |
12c5b204 |
8 | |
1c957fda |
9 | exec <"$case.sys" |
8b1171e6 |
10 | read initfile initflags |
12c5b204 |
11 | read queryargs |
1c957fda |
12 | |
13 | initstring="`cat init-$initfile.text`" |
14 | |
98b6d5b4 |
15 | rm -f $ocase.* |
16 | |
1c957fda |
17 | set +e |
98b6d5b4 |
18 | ADNS_TEST_REPORT_FD=3 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \ |
8b1171e6 |
19 | ./hplayback $initflags "/$initstring" $queryargs |
1c957fda |
20 | rc=$? |
21 | set -e |
22 | |
78bcc172 |
23 | echo "rc=$rc" >>$ocase.out |
1c957fda |
24 | |
73c4c523 |
25 | failed=false |
26 | for part in err out |
1c957fda |
27 | do |
78bcc172 |
28 | if diff -u -- "$case.$part" "$ocase.$part" |
1c957fda |
29 | then |
30 | : |
31 | else |
73c4c523 |
32 | failed=true |
1c957fda |
33 | fi |
34 | done |
35 | |
73c4c523 |
36 | if $failed |
37 | then |
38 | echo >&2 "FAILED $case - WRONG OUTPUT - lines of syscall remaining `wc -l`" |
39 | exit 2 |
40 | fi |
41 | |
39196d5f |
42 | echo -n "$casename " |
1c957fda |
43 | |
44 | exit 0 |