blob: 22f7cab2e8f03e32daced30ed07046387db0d378 [file] [log] [blame]
sewardj2cdc3792015-08-12 10:59:52 +00001#!/bin/sh
sewardj1bad8002005-07-04 23:44:10 +00002
3# Do an automated test which involves building and regtesting version
4# 1.6 of the GNU Scientific Library (gsl). This has proven to be a
5# very thorough test of Vex's CPU simulations and has exposed bugs
6# which had not been previously discovered. Gsl contains more
7# than 100,000 tests as part of its regression suite, and so this
8# script's purpose is to runs those tests using valgrind and compare
9# against the same tests run natively.
10#
11# You can download gsl and get more info about it at
12# http://www.gnu.org/software/gsl
13
14
15
16# Args:
17# absolute name of gsl-1.6.tar.gz file
18# name of C compiler
19# args for C compiler
20# name of Valgrind
21# args for Valgrind
22
florian7d219f82011-11-11 04:04:12 +000023# Results: 3.7.0 --tool=none
24# x86 1 failure Ubuntu 10.10
25# FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs 7.25922435194575979e-15 expected)
26# same failure was also present in 3.6.1
27# s390x 0 failures on z900 running RHEL4
sewardj1bad8002005-07-04 23:44:10 +000028
sewardjd2ea4112005-07-04 23:54:41 +000029if [ $# != 5 ]
30then
sewardj4d3ab3e2005-12-30 22:50:01 +000031 echo "usage: gsl16test /absolute/name/of/gsl-1.6-patched.tar.gz"
sewardjd2ea4112005-07-04 23:54:41 +000032 echo " C-compiler-command"
33 echo " flags-for-C-compiler"
34 echo " Valgrind-command"
35 echo " flags-for-Valgrind"
36 exit 1
37fi
38
39
sewardj1bad8002005-07-04 23:44:10 +000040runcmd () {
41 echo -n " $1 ... "
42 shift
43
44 (eval "$*") >> log.verbose 2>&1
45
florian39e0f542015-05-26 11:52:45 +000046 if [ $? = 0 ]
sewardj1bad8002005-07-04 23:44:10 +000047 then
48 echo "done"
49 return 0
50 else
51 echo "failed"
52 return 1
53 fi
54}
55
56GSL_FILE=$1
57GSL_CC=$2
58GSL_CFLAGS=$3
59GSL_VV=$4
60GSL_VFLAGS=$5
61
62TESTS1="block/test cblas/test cdf/test cheb/test combination/test"
63TESTS2="complex/test const/test deriv/test dht/test diff/test"
64TESTS3="eigen/test err/test fft/test fit/test histogram/test"
65TESTS4="ieee-utils/test integration/test interpolation/test linalg/test"
66TESTS5="matrix/test min/test monte/test multifit/test multimin/test"
67TESTS6="multiroots/test ntuple/test ode-initval/test permutation/test"
68TESTS7="poly/test qrng/test randist/test rng/test roots/test siman/test"
69TESTS8="sort/test specfunc/test statistics/test sum/test sys/test"
70TESTS9="vector/test wavelet/test"
71
72ALL_TESTS="$TESTS1 $TESTS2 $TESTS3 $TESTS4 $TESTS5 $TESTS6 $TESTS7 $TESTS8 $TESTS9"
73
74echo "gsl16test: src: " $GSL_FILE
75echo "gsl16test: cc: " $GSL_CC
76echo "gsl16test: cflags: " $GSL_CFLAGS
77echo "gsl16test: valgrind: " $GSL_VV
78echo "gsl16test: vflags: " $GSL_VFLAGS
79
sewardjb9c7c792005-07-24 11:18:41 +000080rm -rf log.verbose gsl-1.6-patched summary.txt
sewardj1bad8002005-07-04 23:44:10 +000081
82echo > log.verbose
83
sewardjb9c7c792005-07-24 11:18:41 +000084echo > summary.txt
85echo $0 $1 \"$2\" \"$3\" \"$4\" \"$5\" >> summary.txt
86echo >> summary.txt
87
sewardj1bad8002005-07-04 23:44:10 +000088runcmd "Untarring " \
sewardjb9c7c792005-07-24 11:18:41 +000089 "rm -rf gsl-1.6-patched && tar xzf $GSL_FILE" && \
sewardj1bad8002005-07-04 23:44:10 +000090\
91runcmd "Configuring " \
sewardjb262ff42014-11-25 11:43:54 +000092 "(cd gsl-1.6-patched && CC=$GSL_CC CFLAGS=\"$GSL_CFLAGS\" ./configure)" && \
sewardj1bad8002005-07-04 23:44:10 +000093\
94runcmd "Building " \
sewardjb262ff42014-11-25 11:43:54 +000095 "(cd gsl-1.6-patched && make -j4 && make -k check)"
sewardj1bad8002005-07-04 23:44:10 +000096
97echo -n " Collecting reference results "
98rm -f out-REF
sewardjb9c7c792005-07-24 11:18:41 +000099(cd gsl-1.6-patched && for f in $ALL_TESTS ; do ./$f ; done) &> out-REF
sewardj1bad8002005-07-04 23:44:10 +0000100echo " ... done"
101
102echo -n " Collecting valgrinded results "
sewardj4bec7ac2012-06-13 11:12:06 +0000103rm -f out-VAL
104(cd gsl-1.6-patched && for f in $ALL_TESTS ; do eval $GSL_VV -v --trace-children=yes "$GSL_VFLAGS" ./$f ; done) &> out-VAL
sewardj1bad8002005-07-04 23:44:10 +0000105echo " ... done"
106
107echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)
108echo -n " Native passes: " && (grep PASS: out-REF | wc -l)
sewardj4bec7ac2012-06-13 11:12:06 +0000109echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l)
110echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l)
sewardj1bad8002005-07-04 23:44:10 +0000111
sewardjb9c7c792005-07-24 11:18:41 +0000112(echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)) >> summary.txt
113(echo -n " Native passes: " && (grep PASS: out-REF | wc -l)) >> summary.txt
sewardj4bec7ac2012-06-13 11:12:06 +0000114(echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l)) >> summary.txt
115(echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l)) >> summary.txt
sewardjb9c7c792005-07-24 11:18:41 +0000116echo >> summary.txt
117
sewardj1bad8002005-07-04 23:44:10 +0000118echo