]> mj.ucw.cz Git - xsv.git/blob - run-tests
README: Explain the building process slightly better
[xsv.git] / run-tests
1 #!/bin/sh
2 set -e
3
4 for a in tests/????-* ; do
5         echo -n "$a: "
6         rm -rf tmp
7         mkdir tmp
8         ARGS=`head -1 <$a`
9         sed '1d; /^---/,$d' <$a >tmp/in
10         sed '1,/^---/d; /^---/,$d' <$a >tmp/expected-out
11         sed '1,/^---/d; 1,/^---/d' <$a >tmp/expected-err
12         if eval ./xsv $ARGS <tmp/in >tmp/out 2>tmp/err ; then
13                 if ! cmp -s tmp/out tmp/expected-out ; then
14                         echo FAILED
15                         diff -u tmp/expected-out tmp/out
16                         exit 1
17                 elif ! cmp -s tmp/err tmp/expected-err ; then
18                         echo FAILED
19                         diff -u tmp/expected-err tmp/err
20                         exit 1
21                 else
22                         echo OK
23                 fi
24         else
25                 echo FAILED
26                 cat tmp/err
27                 exit 1
28         fi
29 done