fix compiling GHC 6.7+ with itself - compat needs -package containers now
[ghc.git] / validate
1 #!/bin/sh
2
3 set -e
4
5 if [ -f mk/config.mk ]; then
6    make distclean
7 fi
8
9 if [ -f mk/build.mk ]; then
10    mv mk/build.mk mk/build.mk.bak
11 fi
12
13 # The default is a "quick" build
14 echo BuildFlavour=quick >  mk/build.mk
15 echo HADDOCK_DOCS=YES   >> mk/build.mk
16 cat mk/build.mk.sample  >> mk/build.mk
17
18 # You can override the default validate settings using mk/validate.mk
19 # e.g. you could add GhcLibWays=p to test profiling.
20 echo '-include $(TOP)/mk/validate.mk' >>mk/build.mk
21
22 case $OSTYPE in
23   cygwin|msys) config_args=--build=i386-unknown-mingw32
24                if [ -f c:/mingw/bin/gcc.exe ]; then
25                    config_args="$config_args --with-gcc=c:/mingw/bin/gcc"
26                fi
27                ;;
28 esac
29
30 if [ "$CPUS" = "" ]; then
31     threads=2
32 else
33     threads=`expr $CPUS + 1`
34 fi
35
36 sh boot
37 ./configure $config_args
38
39 make -j$threads
40
41 # ToDo: use THREADS=$threads, see #1558
42 make -C testsuite/tests/ghc-regress fast stage=2 CLEANUP=1 2>&1 | tee testlog
43
44 if
45     grep '\<0 caused framework failures' testlog >/dev/null 2>/dev/null &&
46     grep '\<0 unexpected passes' testlog >/dev/null 2>/dev/null &&
47     grep '\<0 unexpected failures' testlog >/dev/null 2>/dev/null ; then
48    echo "-------------------------------------------------------------------"
49    echo "Congratulations!  This tree has passed minimal testing."
50    echo
51    echo "NOTE: If you have made changes that may cause failures not tested"
52    echo "for by the minimal testing procedure, please do further testing"
53    echo "as necessary."
54    echo
55    echo "When you are satisfied that you haven't broken anything, go ahead"
56    echo "and push/send your patches".
57    echo "-------------------------------------------------------------------"
58 else
59    echo "-------------------------------------------------------------------"
60    echo "Oops!  Looks like you have some unexpected test results or"
61    echo "framework failures."
62    echo "Please fix them before pushing/sending patches."
63    echo "-------------------------------------------------------------------"
64 fi