Commit 8256c661 authored by zygzagZ's avatar zygzagZ

Improv test.sh

parent 1bed5bf5
...@@ -30,32 +30,9 @@ make -j8 && for i in lat/lattests/good/*.lat; do ...@@ -30,32 +30,9 @@ make -j8 && for i in lat/lattests/good/*.lat; do
red "ERROR $i" red "ERROR $i"
exit 1 exit 1
fi fi
done && green good OK && for ext in `ls tests/good/`; do done && green good OK &&
ok=1
for i in tests/good/$ext/*.lat; do
($BIN "$i" &>/dev/null);
if ! [ $? -eq 0 ]; then
red "$ext fails on $i";
$BIN "$i"
ok=0;
break;
fi
if [ -f "${i%.*}.input" ]; then for i in lat/lattests/bad/*.lat; do
inp="${i%.*}.input"
else
inp=/dev/null
fi
if ! diff <( $VALGRIND timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then
red "ERROR $i"
ok=0;
fi
done
if [ $ok -eq 1 ]; then
green "OK: $ext passed!"
fi
done && for i in lat/lattests/bad/*.lat; do
t=$((t+1)) t=$((t+1))
($BIN "$i" &>/dev/null); ($BIN "$i" &>/dev/null);
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
...@@ -63,7 +40,9 @@ done && for i in lat/lattests/bad/*.lat; do ...@@ -63,7 +40,9 @@ done && for i in lat/lattests/bad/*.lat; do
$BIN "$i" $BIN "$i"
exit 1; exit 1;
fi fi
done && green "OK: $t bad tests passed!" && for i in tests/bad/semantic/*.lat; do done && green "OK: $t bad tests passed!" &&
for i in tests/bad/semantic/*.lat; do
t=$((t+1)) t=$((t+1))
($BIN "$i" &>/dev/null); ($BIN "$i" &>/dev/null);
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
...@@ -71,7 +50,9 @@ done && green "OK: $t bad tests passed!" && for i in tests/bad/semantic/*.lat; d ...@@ -71,7 +50,9 @@ done && green "OK: $t bad tests passed!" && for i in tests/bad/semantic/*.lat; d
$BIN "$i" $BIN "$i"
exit 1; exit 1;
fi fi
done && green "OK: $t bad+ tests passed!" && for ext in `ls lat/lattests/extensions`; do done && green "OK: $t bad+ tests passed!" &&
for ext in `ls lat/lattests/extensions`; do
ok=1 ok=1
for i in lat/lattests/extensions/$ext/*.lat; do for i in lat/lattests/extensions/$ext/*.lat; do
($BIN "$i" &>/dev/null); ($BIN "$i" &>/dev/null);
...@@ -82,22 +63,29 @@ done && green "OK: $t bad+ tests passed!" && for ext in `ls lat/lattests/extensi ...@@ -82,22 +63,29 @@ done && green "OK: $t bad+ tests passed!" && for ext in `ls lat/lattests/extensi
break; break;
fi fi
if [ -f "${i%.*}.input" ]; then
inp="${i%.*}.input"
else
inp=/dev/null
fi
if ! diff <( $VALGRIND timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then if ! diff <( $VALGRIND timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then
red "ERROR $i" red "ERROR $i"
ok=0 exit 1
break
fi fi
done done
if [ $ok -eq 1 ]; then if [ $ok -eq 1 ]; then
green "OK: $ext passed!" green "OK: ext $ext passed!"
fi fi
done && for ext in `ls tests/extensions`; do done &&
for ext in `ls tests/good/`; do
ok=1 ok=1
for i in lat/lattests/extensions/$ext/*.lat; do for i in tests/good/$ext/*.lat; do
($BIN "$i" &>/dev/null); ($BIN "$i" &>/dev/null);
if ! [ $? -eq 0 ]; then if ! [ $? -eq 0 ]; then
red "$ext fails on $i"; red "$ext+ fails on $i";
$BIN "$i" $BIN "$i"
ok=0; ok=0;
break; break;
...@@ -109,13 +97,12 @@ done && for ext in `ls tests/extensions`; do ...@@ -109,13 +97,12 @@ done && for ext in `ls tests/extensions`; do
inp=/dev/null inp=/dev/null
fi fi
if ! diff <( $VALGRIND timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then if ! diff <( $VALGRIND timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then
red "ERROR $i" red "ERROR $i"
exit 1 ok=0;
fi fi
done done
if [ $ok -eq 1 ]; then if [ $ok -eq 1 ]; then
green "OK: $ext passed!" green "OK: ext+ ${ext} passed!"
fi fi
done done
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment