paul@4 | 1 | #!/bin/sh |
paul@4 | 2 | |
paul@4 | 3 | for FILENAME in tests/* ; do |
paul@4 | 4 | |
paul@4 | 5 | # Detect tests in their own subdirectories. |
paul@4 | 6 | |
paul@4 | 7 | if [ -d "$FILENAME" ] ; then |
paul@4 | 8 | if [ -e "$FILENAME/main.py" ] ; then |
paul@4 | 9 | FILENAME="$FILENAME/main.py" |
paul@4 | 10 | else |
paul@4 | 11 | continue |
paul@4 | 12 | fi |
paul@4 | 13 | fi |
paul@4 | 14 | |
paul@4 | 15 | # Run tests without an existing cache. |
paul@4 | 16 | |
paul@4 | 17 | echo "$FILENAME..." 1>&2 |
paul@4 | 18 | if ! ./lplc "$FILENAME" -r ; then exit 1 ; fi |
paul@39 | 19 | |
paul@39 | 20 | # Check for unresolved names in the cache. |
paul@39 | 21 | |
paul@39 | 22 | echo " (depends)..." 1>&2 |
paul@39 | 23 | if grep '<depends>' -r "_cache" && \ |
paul@39 | 24 | ! echo "$FILENAME" | grep -q '_bad[._]' ; then |
paul@39 | 25 | exit 1 |
paul@39 | 26 | fi |
paul@4 | 27 | |
paul@4 | 28 | # Run tests with an existing cache. |
paul@4 | 29 | |
paul@39 | 30 | echo " (cached)..." 1>&2 |
paul@4 | 31 | if ! ./lplc "$FILENAME" ; then exit 1 ; fi |
paul@4 | 32 | echo 1>&2 |
paul@4 | 33 | |
paul@4 | 34 | done |