libvirt/tests/virconftest.sh
Cole Robinson 856e84a516 tests: consistently source test-lib.sh in scripts
This unifies the test scripts to all use the similar pattern added for
schematests in ace4aecd. This gives the following

- Enables running all tests from outside of tests/ dir
- Drops redundant abs_* definitions, which are set by test-lib.sh
- Drops unnecessary srcdir variable which was only used for sourcing
    test-lib.sh

Behavior changes:

- srcdir can no longer be overwritten, but I don't know why anyone would
    really need to...
- Script VERBOSE setting no longer prints commands executed by test-lib.sh.
    if anyone cares I suggest handling this in test-lib.sh which already
    has other verbose style handling
2016-04-23 15:41:40 -04:00

27 lines
475 B
Bash
Executable File

#!/bin/sh
. "$(dirname $0)/test-lib.sh"
test_intro $this_test
fail=0
i=0
data_dir=$abs_srcdir/confdata
for f in $(cd "$data_dir" && echo *.conf)
do
i=`expr $i + 1`
"$abs_builddir/test_conf" "$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
fail=1
fi
test_result $i "$f" $ret
done
test_final $i $fail
(exit $fail); exit $fail