| #!/bin/tcsh | |
| cp BUILD_VERSION Makefile *.c *.h tests | |
| cd tests | |
| $MAKE -s make_dparser | |
| set failed = 0 | |
| foreach g (*.test.g) | |
| rm -f sample_parser | |
| if (-e $g.flags) then | |
| set flags = `cat $g.flags` | |
| else | |
| set flags = | |
| endif | |
| ./make_dparser $flags $g | |
| $MAKE -s sample_parser SAMPLE_GRAMMAR=$g:t | |
| foreach t ( $g.[0-9] $g.[0-9][0-9] ) | |
| if (-e $t.flags) then | |
| set flags = `cat $t.flags` | |
| else | |
| set flags = | |
| endif | |
| ./sample_parser $flags -v $t >&! $t.out | |
| diff $t.out $t.check | |
| if ($?) then | |
| echo $t "******** FAILED ********" | |
| set failed = `expr $failed + 1` | |
| else | |
| echo $t "PASSED" | |
| endif | |
| end | |
| end | |
| echo "---------------------------------------" | |
| if (! $failed) then | |
| echo "ALL tests PASSED" | |
| else | |
| echo "********" $failed "test(s) FAILED *********" | |
| endif | |
| rm -f sample_parser BUILD_VERSION Makefile *.c *.h *.o make_dparser libdparse.a | |
| cd .. |