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@4 | 19 | echo 1>&2 |
paul@4 | 20 | |
paul@4 | 21 | # Run tests with an existing cache. |
paul@4 | 22 | |
paul@4 | 23 | echo "$FILENAME (cached)..." 1>&2 |
paul@4 | 24 | if ! ./lplc "$FILENAME" ; then exit 1 ; fi |
paul@4 | 25 | echo 1>&2 |
paul@4 | 26 | |
paul@19 | 27 | # Check for unresolved names in the cache. |
paul@19 | 28 | |
paul@19 | 29 | if grep -e '<depends>' -r "_cache" ; then exit 1 ; fi |
paul@19 | 30 | |
paul@4 | 31 | done |