blob: 9a98c498e4ae3ec021349ef7d26e47a013e50ba6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/bin/sh
MANDOC=${MANDOC:-../mandoc}
NROFF=${NROFF:-nroff}
OUTPUT=${NROFF_OUTPUT:--Tascii}
check_skip_list() {
[ -f skip_list ] || return 1
while read file; do
[ "$file" != "$1" ] || return 0
done < skip_list
return 1
}
rm -rf output
echo "Starting regression tests..."
pass=0
failed=0
for file in */*.in */*/*.in; do
[ -f "$file" ] || continue
check_skip_list "$file" && break
printf "%s: " "$file"
${MANDOC} "$file" > test.mandoc 2> /dev/null
${NROFF} ${OUTPUT} -mandoc "$file" > test.nroff 2> /dev/null
mandoclen=`head -n 1 test.mandoc | wc -c`
nrofflen=`head -n 1 test.nroff | wc -c`
if cmp -s test.mandoc test.nroff $mandoclen $nrofflen; then
rm -f test.mandoc test.nroff
echo "passed"
pass=`expr $pass + 1`
else
file2="output/$file"
mkdir -p `dirname $file2`
echo "failed, see $file2"
failed=`expr $failed + 1`
mv test.nroff "${file2}".nroff
mv test.mandoc "${file2}".mandoc
diff -u "${file2}".nroff "${file2}".mandoc > "${file2}".diff
fi
done
echo "Total: $pass passed, $failed failed"
|