Mercurial > hg > silvet
comparison bqvec/build/run-platform-tests.sh @ 372:af71cbdab621 tip
Update bqvec code
author | Chris Cannam |
---|---|
date | Tue, 19 Nov 2019 10:13:32 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
371:426ce52ef096 | 372:af71cbdab621 |
---|---|
1 #!/bin/bash | |
2 | |
3 if [ -z "$1" ]; then | |
4 echo "Usage: $0 <platformtag>" | |
5 exit 2 | |
6 fi | |
7 | |
8 platformtag="$1" | |
9 | |
10 set -eu | |
11 | |
12 ippdir=/opt/intel/ipp | |
13 | |
14 echo | |
15 if [ -d "$ippdir" ]; then | |
16 echo "Found IPP directory $ippdir, considering IPP as well as other options" | |
17 else | |
18 echo "No IPP directory $ippdir, not testing with IPP" | |
19 fi | |
20 | |
21 if valgrind --version >/dev/null 2>&1 ; | |
22 then | |
23 have_valgrind=yes | |
24 else | |
25 echo | |
26 echo "No valgrind executable found, not using valgrind" | |
27 have_valgrind=no | |
28 fi | |
29 | |
30 tmpfile=$(mktemp "/tmp/test_XXXXXX") | |
31 trap "rm -f $tmpfile" 0 | |
32 | |
33 run() { | |
34 successtext="$1" | |
35 shift | |
36 echo -n "Running \"$@\"..." | |
37 if "$@" > "$tmpfile" 2>&1 ; then | |
38 if [ -z "$successtext" ] || fgrep -q "$successtext" "$tmpfile" ; then | |
39 echo " OK" | |
40 return 0 | |
41 else | |
42 echo " Failed" | |
43 cat "$tmpfile" | |
44 return 1 | |
45 fi | |
46 else | |
47 echo " Failed" | |
48 cat "$tmpfile" | |
49 return 1 | |
50 fi | |
51 } | |
52 | |
53 for mf in Makefile build/Makefile.$platformtag build/Makefile.$platformtag.* ; do | |
54 | |
55 case "$mf" in | |
56 *~) continue;; | |
57 *.bak) continue;; | |
58 *ipp) | |
59 if [ ! -d "$ippdir" ]; then | |
60 continue | |
61 fi;; | |
62 esac | |
63 | |
64 if [ ! -f "$mf" ]; then | |
65 continue | |
66 fi | |
67 | |
68 echo | |
69 echo "Building and testing with $mf:" | |
70 echo | |
71 | |
72 make -f "$mf" clean >/dev/null | |
73 run "No errors detected" make -f "$mf" test | |
74 | |
75 if [ "$have_valgrind" = "yes" ]; then | |
76 for t in test-* ; do | |
77 if [ -x "$t" ]; then | |
78 run "no leaks are possible" valgrind --leak-check=full ./"$t" | |
79 fi | |
80 done | |
81 fi | |
82 done | |
83 | |
84 |