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