gcc config
[prop.git] / prop-src / testprop
blob0e45e14211185cbfab41004d5b024613ebf5f750
1 #!/bin/sh
2 TESTDIR=./testpropdir
3 CURDIR=`pwd`
4 errors=0
6 echo "I'm now attempting to regenerate all files in this release using"
7 echo "the new prop compiler and see if everything matches."
8 echo "Current directory is $CURDIR."
9 echo "Making a test directory $TESTDIR."
10 mkdir -p $TESTDIR
11 echo "Testing all .ph files"
12 badfiles=""
13 for ph_file in [a-z]*.ph; do
14 h_file=`echo $ph_file | sed -e 's/\\.ph$/\\.h/'`
15 if [ -f $h_file ]; then
16 awk 'BEGIN { printf "Compiling '${ph_file}' into " }' </dev/null
17 cp $ph_file $TESTDIR
18 cd $TESTDIR
19 $CURDIR/prop -O14 -S -I$CURDIR -I$CURDIR/../include $ph_file
20 cd $CURDIR
21 awk 'BEGIN { printf "Testing '${h_file}'..." }' </dev/null
22 diff $TESTDIR/$h_file $CURDIR/$h_file
23 if [ $? != 0 ]; then
24 echo "Bad"; errors=`expr $errors + 1`;
25 badfiles="$badfiles $h_file"
26 else
27 echo "Ok";
28 fi;
29 rm $TESTDIR/*;
31 done
33 echo "Testing all .pcc files"
34 for pcc_file in [a-z]*.pcc; do
35 cc_file=`echo $pcc_file | sed -e 's/\.pcc$/\.cc/'`
36 if [ -f $cc_file ]; then
37 awk 'BEGIN { printf "Compiling '${pcc_file}' into " }' </dev/null
38 cp $pcc_file $TESTDIR
39 cd $TESTDIR
40 $CURDIR/prop -O14 -S -I$CURDIR -I$CURDIR/../include $pcc_file
41 cd $CURDIR
42 awk 'BEGIN { printf "Testing '${cc_file}'..." }' </dev/null
43 diff $TESTDIR/$cc_file $CURDIR/$cc_file
44 if [ $? != 0 ]; then
45 echo "Bad"; errors=`expr $errors + 1`;
46 badfiles="$badfiles $cc_file"
47 else
48 echo "Ok";
49 fi;
50 rm $TESTDIR/*;
52 done
54 rmdir $TESTDIR
55 if [ $errors != 0 ]; then
56 echo "There are $errors errors";
57 echo "The errors are in: $badfiles";
58 echo "Please send bug report to leunga@cs.nyu.edu"
59 exit 1;
60 else
61 echo "$CURDIR/prop seems to be okay."; exit 0;