summaryrefslogtreecommitdiffstats
path: root/testsuite/consistency
blob: d375b2ecb8b7961a51b6e8454680f405a46db73d (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh

export LANG; LANG=C

case $# in
0) exec make consistency-real;;
esac

srcdir=$1
bindir=$2
libdir=$srcdir/libidu

m_flag="-m $libdir/id-lang.map"

errors=

cmd="$bindir/mkid $m_flag $srcdir"
echo $cmd
if eval $cmd; then
    files="`$bindir/fnid || exit 1`"

    if $bindir/xtokid $m_flag $files |sort -u >ID.xti &&
	$bindir/lid |sed -e 's/[ 	].*//' |sort -u >ID.lid &&
	cmp -s ID.xti ID.lid
    then
	rm -f ID.xti ID.lid
	echo "Good.  xtokid and lid agree."
    else
	mv ID.xti ID.bad-xti
	mv ID.fid ID.bad-fid
	1>&2 echo "Oops!  xtokid and lid disagree--look in ID.bad-{xtokid,lid}"
	errors=t
    fi

    xtokid_file=$$.xti
    fid_file=$$.fid

    for file in $files
    do
	if $bindir/fid $file >$fid_file &&
	    $bindir/xtokid $m_flag $file |sort -u >$xtokid_file &&
	    cmp -s $xtokid_file $fid_file;
	then
	    echo "Good.  xtokid and fid agree for $file"
	else
	    1>&2 echo "Oops!  xtokid and fid disagree for $file--look in $file.bad-{xtokid,fid}"
	    mv $xtokid_file $file.bad-xti
	    mv $fid_file $file.bad-fid
	    errors=t
	fi
    done
    rm -f $xtokid_file $fid_file
else
    1>&2 echo "Oops!  mkid failed."
    errors=t
fi

case x$errors in
xt) echo "Some checks failed."
    exit 1;;
*)  echo "All checks successful."
    exit 0;;
esac