# this works as a bash include
#
#PRIO 0.1
#COMM test *.pl frontends
#COMM   Syntactical test on all frontend executables that do have dependencies on
#COMM   external executables. Run frontends without arguments in order to provoke
#COMM   the usage description. Errors will suppress the expected output
#
for prog in $(ls "$dircode"/[A-Z]*.pl | grep Gap) ; do
  if [ ! -x "$prog" ] ; then continue ; fi

  # run program
  (
    echo testing $prog:
    echo =================================================================
  ) > $dirtest/${setstamp}_usageout
  $prog 2>&1 | tee -a $dirtest/${setstamp}_usageout  \
    | grep '^COMMAND LINE SYNTAX'  \
    > $dirtest/${setstamp}_usagegrep

  # error: no usage output
  if [ ! -s "$dirtest/${setstamp}_usagegrep" ] ; then
    echo ''
    cat $dirtest/${setstamp}_usageout
  fi

  # tidy up
  rm -f $dirtest/${setstamp}_usageout $dirtest/${setstamp}_usagegrep
done
