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