home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / m4-1.1-src.lha / src / amiga / m4-1.1 / checks / check-them < prev    next >
Encoding:
Text File  |  1993-11-08  |  946 b   |  52 lines

  1. #!/bin/sh
  2. # Check GNU m4 against examples from the manual source.
  3. # Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. out=/tmp/m4-out.$$
  6. err=/tmp/m4-err.$$
  7. xout=/tmp/m4-xout.$$
  8. xerr=/tmp/m4-xerr.$$
  9.  
  10. trap "rm -f $out $err $xout $xerr; exit 1" 1 2 3 14 15
  11.  
  12. m4 --version
  13.  
  14. for file
  15. do
  16.   echo "Checking $file"
  17.   m4 -d $file >$out 2>$err
  18.  
  19.   sed -e '/^dnl @result{}/!d' -e 's///' $file > $xout
  20.  
  21.   if cmp -s $out $xout; then
  22.     :
  23.   else
  24.     failed="$failed $file:out"
  25.     echo `sed -e 's/^dnl //' -e 1q $file`
  26.     echo "$file: stdout mismatch"
  27.     diff $out $xout
  28.   fi
  29.  
  30.   sed -e '/^dnl @error{}/!d' -e 's///' $file > $xerr
  31.  
  32.   if cmp -s $err $xerr; then
  33.     :
  34.   else
  35.     failed="$failed $file:err"
  36.     echo `sed -e 's/^dnl //' -e 1q $file`
  37.     echo "$file: stderr mismatch"
  38.     diff $err $xerr
  39.   fi
  40.  
  41. done
  42.  
  43. rm -f $out $err $xout $xerr
  44.  
  45. echo
  46. if test -z "$failed"; then
  47.   echo "All checks successful"
  48. else
  49.   echo "Failed checks were:"
  50.   echo " $failed"
  51. fi
  52.