]> Dogcows Code - chaz/tar/blob - tests/after
Check whether date accepts +format argument (for backup scripts).
[chaz/tar] / tests / after
1 #! /bin/sh
2 # Do common operations after a particular test.
3
4 cd ..
5 exec 1> /dev/null
6 exec 2> /dev/null
7
8 compare() {
9 eval tempfile=tmp-$$/std${1}
10 eval echo \""\${$1}"\" | sed '$d' > ${tempfile}0
11
12 sedscript=tmp-$$/${1}.sed
13 if eval test \".\${${1}_ignore}\" = .; then
14 :
15 else
16 eval echo \"\${${1}_ignore}\" | sed 's,^.*$,/&/d,;' > $sedscript
17 sed -f $sedscript ${tempfile} > ${tempfile}.1
18 mv ${tempfile}.1 ${tempfile}
19 fi
20
21 if eval test -z "\${${1}_regex}" ; then
22 cmp -s ${tempfile}0 ${tempfile} || exit 1
23 else
24 awk '{print NR " " $0}' ${tempfile}0 > ${tempfile}.1
25 awk '{print NR " " $0}' ${tempfile} | join ${tempfile}.1 - |
26 while read NUM RE LINE
27 do
28 echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
29 done
30 fi
31 }
32
33 compare out
34 compare err
35
36 rm -rf tmp-$$
This page took 0.034479 seconds and 4 git commands to generate.