home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / id-utils-3.2-src.tgz / tar.out / fsf / id-utils / testsuite / consistency next >
Text File  |  1996-09-28  |  1KB  |  64 lines

  1. #!/bin/sh
  2.  
  3. export LANG; LANG=C
  4.  
  5. case $# in
  6. 0) exec make consistency-real;;
  7. esac
  8.  
  9. srcdir=$1
  10. bindir=$2
  11. libdir=$srcdir/libidu
  12.  
  13. m_flag="-m $libdir/id-lang.map"
  14.  
  15. errors=
  16.  
  17. cmd="$bindir/mkid $m_flag $srcdir"
  18. echo $cmd
  19. if eval $cmd; then
  20.     files="`$bindir/fnid || exit 1`"
  21.  
  22.     if $bindir/xtokid $m_flag $files |sort -u >ID.xti &&
  23.     $bindir/lid |sed -e 's/[     ].*//' |sort -u >ID.lid &&
  24.     cmp -s ID.xti ID.lid
  25.     then
  26.     rm -f ID.xti ID.lid
  27.     echo "Good.  xtokid and lid agree."
  28.     else
  29.     mv ID.xti ID.bad-xti
  30.     mv ID.fid ID.bad-fid
  31.     1>&2 echo "Oops!  xtokid and lid disagree--look in ID.bad-{xtokid,lid}"
  32.     errors=t
  33.     fi
  34.  
  35.     xtokid_file=$$.xti
  36.     fid_file=$$.fid
  37.  
  38.     for file in $files
  39.     do
  40.     if $bindir/fid $file >$fid_file &&
  41.         $bindir/xtokid $m_flag $file |sort -u >$xtokid_file &&
  42.         cmp -s $xtokid_file $fid_file;
  43.     then
  44.         echo "Good.  xtokid and fid agree for $file"
  45.     else
  46.         1>&2 echo "Oops!  xtokid and fid disagree for $file--look in $file.bad-{xtokid,fid}"
  47.         mv $xtokid_file $file.bad-xti
  48.         mv $fid_file $file.bad-fid
  49.         errors=t
  50.     fi
  51.     done
  52.     rm -f $xtokid_file $fid_file
  53. else
  54.     1>&2 echo "Oops!  mkid failed."
  55.     errors=t
  56. fi
  57.  
  58. case x$errors in
  59. xt) echo "Some checks failed."
  60.     exit 1;;
  61. *)  echo "All checks successful."
  62.     exit 0;;
  63. esac
  64.