#! /bin/sh

#   Copyright (C)  2000    Daniel A. Atkinson
#   Copyright (C)  2004    Ivano Primi  <ivano.primi@tin.it>    

#   Copying and distribution of this file, with or without modification,
#   are permitted in any medium without royalty provided the copyright
#   notice and this notice are preserved.

# script to compare test code output with the sample
# output appended as a comment to the test source code
# parameters: $1 = name of test source
#             $2 to $n = command line parameters for test (if any)

f=$1; shift
cc $f `hpaconf -c -l`      # compile test program
testex $f >tt0             # extract sample output -> tt0
a.out $* >tt1              # run test with output -> tt1
diff tt0 tt1               # compare output to sample output
