tests: New helper cmp_out1
Factor out of cmp_out, then make it optionally take an explicit expected result. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
fed6620a0b
commit
c594b6120e
1 changed files with 49 additions and 37 deletions
|
@ -210,17 +210,30 @@ cmp_logs_xdump()
|
||||||
|
|
||||||
cmp_out()
|
cmp_out()
|
||||||
{
|
{
|
||||||
local i exp act nrm
|
local i
|
||||||
|
|
||||||
for i
|
for i
|
||||||
do
|
do cmp_out1 "$i"
|
||||||
exp="$testdir/${i##*/}"
|
done
|
||||||
act="sandbox/$i"
|
}
|
||||||
nrm="sandbox/normalized-${i##*/}"
|
|
||||||
|
cmp_out1()
|
||||||
|
{
|
||||||
|
local i=$1 exp="${2-$testdir/${1##*/}}"
|
||||||
|
local act="sandbox/$i"
|
||||||
|
local nrm="sandbox/normalized-${i##*/}"
|
||||||
|
|
||||||
if [ ! -e "$exp" ]
|
if [ ! -e "$exp" ]
|
||||||
then
|
then
|
||||||
case "$i" in
|
case "$i" in
|
||||||
|
*.status)
|
||||||
|
exp=sandbox/ok.status
|
||||||
|
echo 0 >sandbox/ok.status
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
[ ! -e "$act" ] && return
|
||||||
|
exp=/dev/null
|
||||||
|
;;
|
||||||
*.status) exp=sandbox/ok.status; echo 0 >sandbox/ok.status ;;
|
*.status) exp=sandbox/ok.status; echo 0 >sandbox/ok.status ;;
|
||||||
*) exp=/dev/null ;;
|
*) exp=/dev/null ;;
|
||||||
esac
|
esac
|
||||||
|
@ -249,5 +262,4 @@ cmp_out()
|
||||||
failed=y
|
failed=y
|
||||||
echo "$i FAIL"
|
echo "$i FAIL"
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue