#! /bin/sh
# Note: When run via "make check", test output files are automatically deleted.
# When run from the command line, output files are left in directory
# MH.YYYYMMDD. This is useful when something is different.
#
# ./inputs/spam.mbx & ./inputs/good.mbx - test inputs
# ./outputs - known correct outputs
#
# MH.YYYYMMDD:
# directory containing individual output files
NODB=1 . ${srcdir=.}/t.frame
OUT="$TMPDIR"/MH.out
CORRECT="$OUTPUTS/MH.out"
for f in good spam ; do
mkdir "$TMPDIR"/$f
cat ${srcdir}/inputs/$f.mbx | (cd "$TMPDIR"/$f && splitmbox )
done
$BOGOFILTER -C -D -n $v -B "$TMPDIR"/good
$BOGOFILTER -C -D -s $v -B "$TMPDIR"/spam
wordlist=".MSG_COUNT Lotus Magazine Min Service connection more most set that unsubscribe"
$BOGOUTIL -C -w "$WORDLIST" $wordlist > "$OUT" || rm -f "$OUT"
if [ $verbose -eq 0 ]; then
cmp "$CORRECT" "$OUT"
else
diff $DIFF_BRIEF "$CORRECT" "$OUT"
fi