summaryrefslogtreecommitdiff
path: root/run-test-suite.sh
blob: 4ae55614b32f73465022aae5ced2afb8f23b47a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash -ex

UNIT_TEST_PARAMS="--quickcheck-max-size 30 --quickcheck-tests 100"

if [ "$1" == "--profile" ] ; then
  shift
  stack build --profile --flag lambdacube-compiler:testsuite --flag lambdacube-compiler:profiling --flag lambdacube-compiler:-cli -j3
  set +e
  RESULT_UNITTESTS=0
  stack exec lambdacube-compiler-test-suite -- -r -iperformance -i.ignore $@ +RTS -p
  RESULT_TESTS=`echo $?`
elif [ "$1" == "--coverage" ] ; then
  shift
  set +e
  stack build --flag lambdacube-compiler:coverage --flag lambdacube-compiler:alltest -j3
  stack exec lambdacube-compiler-unit-tests -- $UNIT_TEST_PARAMS
  RESULT_UNITTESTS=`echo $?`
  stack exec lambdacube-compiler-coverage-test-suite -- -iperformance -i.ignore -r $@
  RESULT_TESTS=`echo $?`
  ./create-test-report.sh
  rm lambdacube-compiler-coverage-test-suite.tix
else
  set +e
  stack build --flag lambdacube-compiler:alltest -j3
  stack exec lambdacube-compiler-unit-tests -- $UNIT_TEST_PARAMS
  RESULT_UNITTESTS=`echo $?`
  stack exec lambdacube-compiler-test-suite -- -iperformance -i.ignore -r $@
  RESULT_TESTS=`echo $?`
fi

if [[ $RESULT_UNITTESTS -ne 0 ]]; then
  echo "***************************"
  echo "* Unit tests are failing. *"
  echo "***************************"
fi

if [[ $RESULT_TESTS -ne 0 ]]; then
  echo "*******************************"
  echo "* Compiler tests are failing. *"
  echo "*******************************"
fi

exit $((RESULT_TESTS + RESULT_UNITTESTS))