freebsd-skq/tools/regression/geom/RunTest.t
nik 3e959a33f9 Switch over to a different, more flexible test output protocol that's
understood by Perl's Test::Harness module and prove(1) commands.

Update README to describe the new protocol.  The work's broken down into
two main sets of changes.

First, update the existing test programs (shell scripts and C programs)
to produce output in the ok/not ok format, and to, where possible, also
produce a header describing the number of tests that are expected to be
run.

Second, provide the .t files that actually run the tests.  In some cases
these are copies of, or very similar too, scripts that already existed.
I've kept the old scripts around so that it's possible to verify that
behaviour under this new system (in terms of whether or not a test fails)
is identical to the behaviour under the old system.

Add a TODO file.
2004-11-11 19:47:55 +00:00

51 lines
844 B
Bash

#!/bin/sh
# $FreeBSD$
MD=34
TMP=/tmp/$$
set -e
# Start from the right directory so we can find all our data files.
cd `dirname $0`
(cd MdLoad && make) > /dev/null 2>&1
# Print the test header
echo -n '1..'
echo `ls -1 Data/disk.*.xml | wc -l`
for f in Data/disk.*.xml
do
b=`basename $f`
mdconfig -d -u $MD > /dev/null 2>&1 || true
if [ -c /dev/md$MD ] ; then
sleep 1
fi
if [ -c /dev/md$MD ] ; then
sleep 1
fi
if [ -c /dev/md$MD ] ; then
echo "Bail out!"
echo "/dev/md$MD is busy"
exit 1
fi
MdLoad/MdLoad md${MD} $f
if [ -f Ref/$b ] ; then
if diskinfo /dev/md${MD}* |
diff -I '$FreeBSD' -u Ref/$b - > $TMP; then
echo "ok - $b"
else
echo "not ok - $b"
sed 's/^/# /' $TMP
fi
else
diskinfo /dev/md${MD}* > Ref/`basename $f`
fi
done
mdconfig -d -u $MD > /dev/null 2>&1 || true
rm -f $TMP
exit 0