2006-11-19 07:28:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2006-11-29 03:55:57 +00:00
|
|
|
run_init()
|
2006-11-19 07:45:46 +00:00
|
|
|
{
|
|
|
|
for script in emp-???.awk
|
|
|
|
do
|
|
|
|
output=`echo $script | sed 's/\.awk$/.out/g'`
|
|
|
|
./awk $script emp-en.data > "$output"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2006-11-29 03:55:57 +00:00
|
|
|
run_test()
|
2006-11-19 07:45:46 +00:00
|
|
|
{
|
|
|
|
pid=$$
|
|
|
|
|
|
|
|
for script in emp-???.awk
|
|
|
|
do
|
|
|
|
output=`echo $script | sed 's/\.awk$/.out/g'`
|
|
|
|
./awk $script emp-en.data > "$output.$pid"
|
|
|
|
|
2006-11-29 05:35:54 +00:00
|
|
|
#diff -y $output "$output.$pid"
|
|
|
|
diff $output "$output.$pid"
|
2006-11-19 07:45:46 +00:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "###################################"
|
|
|
|
echo "PROBLEM(S) DETECTED IN $script.".
|
|
|
|
echo "###################################"
|
|
|
|
rm -f "$output.$pid"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
|
2006-11-19 07:28:33 +00:00
|
|
|
rm -f "$output.$pid"
|
2006-11-19 07:45:46 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
#--------#
|
|
|
|
# main #
|
|
|
|
#--------#
|
|
|
|
|
2006-11-19 09:28:55 +00:00
|
|
|
if [ ! -x ./awk ]
|
|
|
|
then
|
|
|
|
echo "Error: cannot locate a relevant awk interpreter"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2006-11-19 07:45:46 +00:00
|
|
|
if [ $# -ne 1 ]
|
|
|
|
then
|
|
|
|
echo "Usage: $0 init"
|
|
|
|
echo " $0 test"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "init" ]
|
|
|
|
then
|
2006-11-29 03:55:57 +00:00
|
|
|
run_init
|
2006-11-19 07:45:46 +00:00
|
|
|
elif [ "$1" = "test" ]
|
|
|
|
then
|
2006-11-29 03:55:57 +00:00
|
|
|
run_test
|
2006-11-19 07:45:46 +00:00
|
|
|
else
|
|
|
|
echo "Usage: $0 init"
|
|
|
|
echo " $0 test"
|
|
|
|
exit 1
|
|
|
|
fi
|
2006-11-19 07:28:33 +00:00
|
|
|
|