Skip to content
Newer
Older
100644 131 lines (110 sloc) 3.37 KB
83331f7 @igfoo Use "set -e" in validate, so "sh validate" still has it set
igfoo authored Jul 29, 2007
1 #!/bin/sh
2
7a7b51a Add comments explaining flags
simonpj@microsoft.com authored Feb 28, 2008
3 # Flags:
3a26865 @igfoo Fix typo
igfoo authored Mar 2, 2008
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
8df3ac7 @igfoo Make a "validate --hpc"; shows how much of the compiler the testsuite…
igfoo authored Jul 1, 2008
8 # --hpc: build stage2 with -fhpc, and see how much of the
982f6e5 @igfoo Add --slow (and --fast) options to validate
igfoo authored Jul 1, 2008
9 # compiler the test suite covers.
10 # 2008-07-01: 63% slower than the default.
69adcec @igfoo Add a comment in validate saying where the hpc HTML is put
igfoo authored Jul 7, 2008
11 # HTML generated here: testsuite/hpc_output/hpc_index.html
982f6e5 @igfoo Add --slow (and --fast) options to validate
igfoo authored Jul 1, 2008
12 # --fast: Default. Opposite to --slow.
13 # --slow: Build stage2 with -DDEBUG.
14 # 2008-07-01: 14% slower than the default.
7a7b51a Add comments explaining flags
simonpj@microsoft.com authored Feb 28, 2008
15
83331f7 @igfoo Use "set -e" in validate, so "sh validate" still has it set
igfoo authored Jul 29, 2007
16 set -e
8ce457c Add first cut of the validate script
Simon Marlow authored Jul 4, 2007
17
81553ff @igfoo Allow skipping "make clean" or only re-running the testsuite in validate
igfoo authored Feb 10, 2008
18 no_clean=0
19 testsuite_only=0
982f6e5 @igfoo Add --slow (and --fast) options to validate
igfoo authored Jul 1, 2008
20 hpc=NO
21 slow=NO
81553ff @igfoo Allow skipping "make clean" or only re-running the testsuite in validate
igfoo authored Feb 10, 2008
22
23 while [ $# -gt 0 ]
24 do
25 case "$1" in
26 --no-clean)
27 no_clean=1
28 ;;
29 --testsuite-only)
30 testsuite_only=1
31 ;;
8df3ac7 @igfoo Make a "validate --hpc"; shows how much of the compiler the testsuite…
igfoo authored Jul 1, 2008
32 --hpc)
982f6e5 @igfoo Add --slow (and --fast) options to validate
igfoo authored Jul 1, 2008
33 hpc=YES
34 ;;
35 --slow)
36 slow=YES
37 ;;
38 --fast)
39 slow=NO
8df3ac7 @igfoo Make a "validate --hpc"; shows how much of the compiler the testsuite…
igfoo authored Jul 1, 2008
40 ;;
81553ff @igfoo Allow skipping "make clean" or only re-running the testsuite in validate
igfoo authored Feb 10, 2008
41 *)
42 echo "Bad argument: $1" >&2
43 exit 1;;
44 esac
45 shift
46 done
47
ea195ee @igfoo Don't boot/configure if we are validating --no-clean
igfoo authored Aug 4, 2008
48 if [ "$CPUS" = "" ]; then
49 threads=2
50 else
51 threads=`expr $CPUS + 1`
52 fi
53
81553ff @igfoo Allow skipping "make clean" or only re-running the testsuite in validate
igfoo authored Feb 10, 2008
54 if [ $testsuite_only -eq 0 ]; then
55
1935abf @igfoo Ooops; lack of mk/confi.mk doesn't mean validate shouldn't run config…
igfoo authored Aug 6, 2008
56 if [ $no_clean -eq 0 ]; then
57 if [ -f mk/config.mk ]; then
58 make distclean
59 fi
8ce457c Add first cut of the validate script
Simon Marlow authored Jul 4, 2007
60
ea195ee @igfoo Don't boot/configure if we are validating --no-clean
igfoo authored Aug 4, 2008
61 case $OSTYPE in
62 cygwin|msys) config_args=--build=i386-unknown-mingw32
63 if [ -f c:/mingw/bin/gcc.exe ]
64 then
65 config_args="$config_args --with-gcc=c:/mingw/bin/gcc"
66 fi
67 ;;
68 esac
2924c4b make validate work on Windows
Simon Marlow authored Jul 25, 2007
69
ea195ee @igfoo Don't boot/configure if we are validating --no-clean
igfoo authored Aug 4, 2008
70 sh boot
71 ./configure "--prefix=`pwd`/inst" $config_args
2924c4b make validate work on Windows
Simon Marlow authored Jul 25, 2007
72 fi
73
8df3ac7 @igfoo Make a "validate --hpc"; shows how much of the compiler the testsuite…
igfoo authored Jul 1, 2008
74 thisdir=`utils/pwd/pwd forwardslash`
75
6594f91 @igfoo Change how we know whether or not we are validating
igfoo authored Aug 17, 2008
76 echo "Validating=YES" > mk/are-validating.mk
77
78 make -j$threads ValidateHpc=$hpc ValidateSlow=$slow
81553ff @igfoo Allow skipping "make clean" or only re-running the testsuite in validate
igfoo authored Feb 10, 2008
79 fi # testsuite-only
8ce457c Add first cut of the validate script
Simon Marlow authored Jul 4, 2007
80
982f6e5 @igfoo Add --slow (and --fast) options to validate
igfoo authored Jul 1, 2008
81 if [ "$hpc" = YES ]
8df3ac7 @igfoo Make a "validate --hpc"; shows how much of the compiler the testsuite…
igfoo authored Jul 1, 2008
82 then
83 # XXX With threads we'd need to give a different tix file to each thread
84 # and then sum them up at the end
85 threads=1
86 HPCTIXFILE=$thisdir/testsuite/hpc_output/ghc.tix
87 export HPCTIXFILE
88 rm -f $HPCTIXFILE
89 fi
90
6594f91 @igfoo Change how we know whether or not we are validating
igfoo authored Aug 17, 2008
91 make -C testsuite/tests/ghc-regress fast stage=2 CLEANUP=1 THREADS=$threads 2>&1 | tee testlog
8ce457c Add first cut of the validate script
Simon Marlow authored Jul 4, 2007
92
982f6e5 @igfoo Add --slow (and --fast) options to validate
igfoo authored Jul 1, 2008
93 if [ "$hpc" = YES ]
8df3ac7 @igfoo Make a "validate --hpc"; shows how much of the compiler the testsuite…
igfoo authored Jul 1, 2008
94 then
95 utils/hpc/hpc markup --hpcdir=. --srcdir=compiler --srcdir=testsuite/hpc_output --destdir=testsuite/hpc_output testsuite/hpc_output/ghc.tix
96 fi
97
81553ff @igfoo Allow skipping "make clean" or only re-running the testsuite in validate
igfoo authored Feb 10, 2008
98 echo "-------------------------------------------------------------------"
17c564c @igfoo Check for framework failures and unexpected passes in validate
igfoo authored Jul 22, 2007
99 if
100 grep '\<0 caused framework failures' testlog >/dev/null 2>/dev/null &&
101 grep '\<0 unexpected passes' testlog >/dev/null 2>/dev/null &&
102 grep '\<0 unexpected failures' testlog >/dev/null 2>/dev/null ; then
81553ff @igfoo Allow skipping "make clean" or only re-running the testsuite in validate
igfoo authored Feb 10, 2008
103 if [ $testsuite_only -eq 0 ] && [ $no_clean -eq 0 ]
104 then
105 cat <<EOF
106 Congratulations! This tree has passed minimal testing.
107
108 NOTE: If you have made changes that may cause failures not tested for by
109 the minimal testing procedure, please do further testing as necessary.
110
111 When you are satisfied that you haven't broken anything, go ahead and
112 push/send your patches.
113 EOF
114 else
115 cat <<EOF
116 I didn't find any problems, but this wasn't a complete validate run,
117 so be careful!
118
119 NOTE: If you have made changes that may cause failures not tested for by
120 the minimal testing procedure, please do further testing as necessary.
121 EOF
122 fi
8ce457c Add first cut of the validate script
Simon Marlow authored Jul 4, 2007
123 else
81553ff @igfoo Allow skipping "make clean" or only re-running the testsuite in validate
igfoo authored Feb 10, 2008
124 cat <<EOF
125 Oops! Looks like you have some unexpected test results or framework failures.
126 Please fix them before pushing/sending patches.
127 EOF
8ce457c Add first cut of the validate script
Simon Marlow authored Jul 4, 2007
128 fi
81553ff @igfoo Allow skipping "make clean" or only re-running the testsuite in validate
igfoo authored Feb 10, 2008
129 echo "-------------------------------------------------------------------"
130
Something went wrong with that request. Please try again.