libvirt/tests/test_conf.sh

29 lines
504 B
Bash
Raw Normal View History

2008-04-18 15:28:33 +00:00
#!/bin/sh
test -z "$srcdir" && srcdir=$(pwd)
2008-04-18 15:28:33 +00:00
. "$srcdir/test-lib.sh"
2008-04-18 15:28:33 +00:00
test_intro $this_test
2008-04-18 15:28:33 +00:00
fail=0
i=0
2008-04-18 15:28:33 +00:00
data_dir=$abs_srcdir/confdata
for f in $(cd "$data_dir" && echo *.conf)
do
i=`expr $i + 1`
2008-04-18 15:28:33 +00:00
"$abs_builddir/conftest" "$data_dir/$f" > "$f-actual"
expected="$data_dir"/`echo "$f" | sed s+\.conf$+\.out+`
if compare "$expected" "$f-actual"; then
ret=0
else
ret=1
2008-04-18 15:28:33 +00:00
fail=1
fi
test_result $i "$f" $ret
done
2008-04-18 15:28:33 +00:00
test_final $i $fail
2008-04-18 15:28:33 +00:00
(exit $fail); exit $fail