#!/bin/sh

unset CLASSPATH

rm -f *.class

OPTIONS="-language:implicitConversions,postfixOps,reflectiveCalls -cp `pwd`/../../bin"
RUNOPTIONS="-cp `pwd`/../../bin:."

export JAVA_OPTS="-Xss20000k -Xmx1500m"

TESTS="TestExtArray SetTest VectorTest PairTest CartTest CartTest2 ComplexTest"

for testname in $TESTS; do
  echo
  echo $testname
  scalac $OPTIONS $testname.scala
  scala $RUNOPTIONS $testname
done

TESTS="ArrayQuantifiers.scala"

for testname in $TESTS; do
  echo
  echo $testname
  scala $OPTIONS $testname
done

# Test cases that are use the SMT-LIB parser, which needs additional libraries

OPTIONS="-language:implicitConversions,postfixOps,reflectiveCalls -cp `pwd`/../../bin:`pwd`/../../extlibs/java-cup-11a.jar:`pwd`/../../smt-parser/smt-parser.jar"

TESTS="ExtArrayCrash.scala"

for testname in $TESTS; do
  echo
  echo $testname
  scala $OPTIONS $testname
done
