forked from zerovm/sphinx-port
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smoke.sh
executable file
·59 lines (46 loc) · 1.33 KB
/
smoke.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
SHELL='/bin/sh'
jobs=$(grep -c processor /proc/cpuinfo)
[ "z$FAILLOG" = "z" ] && FAILLOG="/tmp/faillog"
LINE="-------------------------------\n"
if [ q"1" = q"$jobs" ] ; then
jobs=""
else
jobs="-j$jobs"
fi
die()
{
cat $FAILLOG
echo $LINE
[ ! "z$2" = "z" ] && { eval $2; echo "$LINE"; }
echo "$1"
[ -e "$FAILLOG" ] && rm $FAILLOG
exit 1
}
cmd1 ()
{
echo "Executing: $2\n">$FAILLOG
eval $2 1>>$1 2>&1 || die "$3" "$4"
}
cmd ()
{
cmd1 "$FAILLOG" "$1" "$2" "$3"
}
cmd "mysql -utest test < example.sql" "Documents setup failed. Log in into mysql as admin and perform: CREATE DATABASE test; CREATE USER test@localhost; GRANT ALL PRIVILEGES ON test.* TO test@localhost;"
for CONFARGS in "--with-debug" "--with-debug --enable-id64";
do
BANNER="testing $CONFARGS build"
cmd "$SHELL ./configure $CONFARGS" "$BANNER: configure failed"
cmd "make clean" "$BANNER: make clean failed"
cmd "make $jobs" "$BANNER: make failed"
cmd1 "/dev/null" "cd ./test; php ubertest.php t -u test --strict-verbose --no-demo" "$BANNER: regression suite failed" "cat report.txt; rm report.txt"
cd ..
cmd "cd ./src; ./tests" "$BANNER: unit tests failed"
cd ..
cmd "cd ./api/libsphinxclient; ./smoke_test.sh" "$BANNER: C API tests failed"
cd ../../
done
make clean 1>/dev/null 2>&1
[ -e "$FAILLOG" ] && rm "$FAILLOG"
echo "all ok\n"
exit 0