6 # TODO(jmmv): The Kyua TAP interface should be passing us the value of
7 # "srcdir" as an environment variable, just as it does with the ATF
8 # interface in the form of a configuration variable. For now, just try
10 : ${TESTS_DATA:=$(dirname ${0})}
16 COUNTER=$((COUNTER+1))
17 ${SH} $1 > tmp.stdout 2> tmp.stderr
18 if [ $? -ne $2 ]; then
19 echo "not ok ${c} - ${1} # wrong exit status"
20 rm tmp.stdout tmp.stderr
23 sed -I '' -e "s|^${TESTS_DATA}|.|" tmp.stderr
24 for i in stdout stderr; do
25 if [ -f ${1}.${i} ]; then
26 if ! cmp -s tmp.${i} ${1}.${i}; then
27 echo "not ok ${c} - ${1} # wrong output on ${i}"
28 rm tmp.stdout tmp.stderr
31 elif [ -s tmp.${i} ]; then
32 echo "not ok ${c} - ${1} # wrong output on ${i}"
33 rm tmp.stdout tmp.stderr
38 rm tmp.stdout tmp.stderr
41 TESTS=$(find -Es ${TESTS_DATA} -regex ".*\.[0-9]+")
42 printf "1..%d\n" $(echo ${TESTS} | wc -w)
44 for i in ${TESTS} ; do