Documentation only: update External Core section of user guide
[ghc-hetmet.git] / validate
1 #!/bin/sh
2
3 set -e
4
5 no_clean=0
6 testsuite_only=0
7
8 while [ $# -gt 0 ]
9 do
10     case "$1" in
11     --no-clean)
12         no_clean=1
13         ;;
14     --testsuite-only)
15         testsuite_only=1
16         ;;
17     *)
18         echo "Bad argument: $1" >&2
19         exit 1;;
20     esac
21     shift
22 done
23
24 if [ $testsuite_only -eq 0 ]; then
25
26 if [ $no_clean -eq 0 ] && [ -f mk/config.mk ]; then
27     make distclean
28 fi
29
30 case $OSTYPE in
31     cygwin|msys) config_args=--build=i386-unknown-mingw32
32         if [ -f c:/mingw/bin/gcc.exe ]
33         then
34             config_args="$config_args --with-gcc=c:/mingw/bin/gcc"
35         fi
36         ;;
37 esac
38
39 if [ "$CPUS" = "" ]; then
40     threads=2
41 else
42     threads=`expr $CPUS + 1`
43 fi
44
45 sh boot
46 ./configure $config_args
47
48 make Validating=YES -j$threads
49 fi # testsuite-only
50
51 # ToDo: use THREADS=$threads, see #1558
52 make Validating=YES -C testsuite/tests/ghc-regress fast stage=2 CLEANUP=1 2>&1 | tee testlog
53
54 echo "-------------------------------------------------------------------"
55 if
56     grep '\<0 caused framework failures' testlog >/dev/null 2>/dev/null &&
57     grep '\<0 unexpected passes' testlog >/dev/null 2>/dev/null &&
58     grep '\<0 unexpected failures' testlog >/dev/null 2>/dev/null ; then
59     if [ $testsuite_only -eq 0 ] && [ $no_clean -eq 0 ]
60     then
61         cat <<EOF
62 Congratulations!  This tree has passed minimal testing.
63
64 NOTE: If you have made changes that may cause failures not tested for by
65 the minimal testing procedure, please do further testing as necessary.
66
67 When you are satisfied that you haven't broken anything, go ahead and
68 push/send your patches.
69 EOF
70     else
71         cat <<EOF
72 I didn't find any problems, but this wasn't a complete validate run,
73 so be careful!
74
75 NOTE: If you have made changes that may cause failures not tested for by
76 the minimal testing procedure, please do further testing as necessary.
77 EOF
78    fi
79 else
80     cat <<EOF
81 Oops!  Looks like you have some unexpected test results or framework failures.
82 Please fix them before pushing/sending patches.
83 EOF
84 fi
85 echo "-------------------------------------------------------------------"
86