2013-04-16 23:59:17 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
# build.check.bash --revision=10500 --ftcc=icc
|
|
|
|
# build.check.bash --tokudb=tokudb.1489 --revision=10500 --ftcc=gcc44
|
2013-04-16 23:59:17 -04:00
|
|
|
# build.check.bash --branch=mysql.branches/1.1.3 --revision=10500
|
|
|
|
|
|
|
|
function usage() {
|
|
|
|
echo "build tokudb and run regressions"
|
2013-04-17 00:00:05 -04:00
|
|
|
echo "--branch=$branch --tokudb=$tokudb --revision=$revision --bdb=$bdb"
|
|
|
|
echo "--ftcc=$ftcc --VALGRIND=$VALGRIND --makejobs=$makejobs --parallel=$parallel"
|
|
|
|
echo "--debugtests=$debugtests --releasetests=$releasetests"
|
|
|
|
echo "--commit=$commit"
|
2013-04-16 23:59:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
function retry() {
|
|
|
|
local cmd
|
|
|
|
local retries
|
|
|
|
local exitcode
|
|
|
|
cmd=$*
|
|
|
|
let retries=0
|
|
|
|
while [ $retries -le 10 ] ; do
|
2013-04-17 00:00:06 -04:00
|
|
|
echo $(date) $cmd
|
2013-04-16 23:59:17 -04:00
|
|
|
bash -c "$cmd"
|
|
|
|
exitcode=$?
|
2013-04-17 00:00:06 -04:00
|
|
|
echo $(date) $cmd $exitcode $retries
|
2013-04-16 23:59:17 -04:00
|
|
|
let retries=retries+1
|
|
|
|
if [ $exitcode -eq 0 ] ; then break; fi
|
|
|
|
sleep 10
|
|
|
|
done
|
|
|
|
test $exitcode = 0
|
|
|
|
}
|
|
|
|
|
|
|
|
# delete some characters that cygwin and osx have trouble with
|
|
|
|
function sanitize() {
|
|
|
|
tr -d '[/:\\\\()]'
|
|
|
|
}
|
|
|
|
|
|
|
|
function mydate() {
|
|
|
|
date +"%Y%m%d %H:%M:%S"
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_ncpus() {
|
|
|
|
grep bogomips /proc/cpuinfo | wc -l
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_latest_svn_revision() {
|
|
|
|
local revision=0
|
|
|
|
local svntarget=$svnserver/$*
|
2013-04-17 00:00:06 -04:00
|
|
|
local latest=$(retry svn info $svntarget)
|
2013-04-17 00:00:13 -04:00
|
|
|
if [[ $latest =~ Last\ Changed\ Rev:\ ([0-9]+) ]] ; then
|
2013-04-16 23:59:17 -04:00
|
|
|
revision=${BASH_REMATCH[1]}
|
|
|
|
fi
|
|
|
|
echo $revision
|
|
|
|
}
|
|
|
|
|
|
|
|
function make_tokudb_name() {
|
|
|
|
local tokudb_dir=$1
|
|
|
|
local tokudb=$2
|
|
|
|
if [ $tokudb_dir = "toku" ] ; then
|
|
|
|
echo $tokudb
|
|
|
|
else
|
2013-04-17 00:00:06 -04:00
|
|
|
echo $(echo $tokudb_dir-$tokudb | tr / -)
|
2013-04-16 23:59:17 -04:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# run a command and trace its result
|
|
|
|
function runcmd() {
|
|
|
|
local fail=$1; shift
|
|
|
|
local makedir=$1; shift
|
|
|
|
local cmd=$*
|
|
|
|
|
2013-04-17 00:00:06 -04:00
|
|
|
echo $(mydate) $makedir $cmd
|
2013-04-16 23:59:17 -04:00
|
|
|
pushd $makedir
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ $? = 0 ] ; then
|
|
|
|
$cmd
|
|
|
|
exitcode=$?
|
|
|
|
local dir=$makedir
|
2013-04-17 00:00:13 -04:00
|
|
|
if [[ $dir =~ $HOME/svn.build/(.*) ]] ; then
|
2013-04-17 00:00:05 -04:00
|
|
|
dir=${BASH_REMATCH[1]}
|
|
|
|
fi
|
2013-04-17 00:00:08 -04:00
|
|
|
result="$(mydate) $dir $cmd"
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ $fail -eq 0 ] ; then
|
|
|
|
if [ $exitcode -eq 0 ] ; then
|
2013-04-17 00:00:08 -04:00
|
|
|
result="PASS $result"
|
2013-04-17 00:00:05 -04:00
|
|
|
else
|
2013-04-17 00:00:08 -04:00
|
|
|
result="FAIL $result"
|
2013-04-17 00:00:05 -04:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ $exitcode -eq 0 ] ; then
|
2013-04-17 00:00:08 -04:00
|
|
|
result="XPASS $result"
|
2013-04-17 00:00:05 -04:00
|
|
|
else
|
2013-04-17 00:00:08 -04:00
|
|
|
result="XFAIL $result"
|
2013-04-17 00:00:05 -04:00
|
|
|
fi
|
|
|
|
fi
|
2013-04-16 23:59:17 -04:00
|
|
|
fi
|
|
|
|
echo $result
|
|
|
|
echo $result >>$commit_msg
|
2013-04-17 00:00:09 -04:00
|
|
|
echo $result >>/tmp/$(whoami).build.check.trace
|
2013-04-16 23:59:17 -04:00
|
|
|
popd
|
|
|
|
}
|
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
function my_mktemp() {
|
2013-04-17 00:00:05 -04:00
|
|
|
mktemp /tmp/$(whoami).$1.XXXXXXXXXX
|
2013-04-17 00:00:05 -04:00
|
|
|
}
|
|
|
|
|
2013-04-16 23:59:17 -04:00
|
|
|
# build a version of tokudb with a specific BDB target
|
|
|
|
function build() {
|
|
|
|
|
|
|
|
# setup build environment
|
2013-04-17 00:00:07 -04:00
|
|
|
export BDBVERSION=$1
|
2013-04-17 00:00:13 -04:00
|
|
|
if [[ $BDBVERSION =~ ([0-9]+)\.([0-9]+) ]] ;then
|
2013-04-16 23:59:17 -04:00
|
|
|
export BDBMAJOR=${BASH_REMATCH[1]}
|
|
|
|
export BDBMINOR=${BASH_REMATCH[2]}
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
fi
|
2013-04-17 00:00:07 -04:00
|
|
|
export BDBDIR=/usr/local/BerkeleyDB.$BDBVERSION
|
2013-04-16 23:59:17 -04:00
|
|
|
if [ ! -d $BDBDIR ] ; then return 2; fi
|
|
|
|
|
2013-04-17 00:00:06 -04:00
|
|
|
tokudb_name=$(make_tokudb_name $branch $tokudb)
|
2013-04-16 23:59:17 -04:00
|
|
|
export TOKUDB_NAME=$tokudb_name
|
|
|
|
export TOKUDB_REVISION=$revision
|
|
|
|
|
|
|
|
productname=$tokudb_name-$revision
|
|
|
|
checkout=$branch/$tokudb
|
|
|
|
|
2013-04-17 00:00:06 -04:00
|
|
|
latestrev=$(get_latest_svn_revision $checkout)
|
2013-04-16 23:59:17 -04:00
|
|
|
if [ $latestrev -eq 0 ] ; then return 3; fi
|
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
commit_msg=$(my_mktemp ft)
|
2013-04-16 23:59:17 -04:00
|
|
|
|
|
|
|
svnbase=~/svn.build
|
|
|
|
if [ ! -d $svnbase ] ; then mkdir $svnbase ; fi
|
|
|
|
|
|
|
|
# checkout the build dir
|
|
|
|
buildbase=$svnbase/tokudb.build
|
|
|
|
if [ ! -d $buildbase ] ; then
|
2013-04-16 23:59:38 -04:00
|
|
|
mkdir $buildbase
|
2013-04-16 23:59:17 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# make the build directory, possibly on multiple machines simultaneously, there can be only one
|
|
|
|
builddir=$buildbase/$date
|
|
|
|
pushd $buildbase
|
|
|
|
while [ ! -d $date ] ; do
|
2013-04-16 23:59:38 -04:00
|
|
|
svn mkdir $svnserver/tokudb.build/$date -m ""
|
|
|
|
svn co -q $svnserver/tokudb.build/$date
|
|
|
|
if [ $? -ne 0 ] ; then rm -rf $date; fi
|
2013-04-16 23:59:17 -04:00
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
2013-04-17 00:00:07 -04:00
|
|
|
tracefile=$builddir/$productname+$ftcc-$GCCVERSION+bdb-$BDBVERSION+$nodename+$system+$release+$arch
|
2013-04-17 00:00:09 -04:00
|
|
|
if [ $have_cilk != 0 ] ; then tracefile=$tracefile+cilk; fi
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ $debugtests != 0 ] ; then tracefile=$tracefile+debug; fi
|
|
|
|
if [ $releasetests != 0 ] ; then tracefile=$tracefile+release; fi
|
2013-04-16 23:59:17 -04:00
|
|
|
|
|
|
|
# get some config info
|
2013-04-17 00:00:05 -04:00
|
|
|
uname -a >$tracefile 2>&1
|
|
|
|
ulimit -a >>$tracefile 2>&1
|
|
|
|
$ftcc -v >>$tracefile 2>&1
|
2013-04-17 00:00:14 -04:00
|
|
|
valgrind --version >>$tracefile 2>&1
|
|
|
|
cat /etc/issue >>$tracefile 2>&1
|
2013-04-17 00:00:05 -04:00
|
|
|
cat /proc/version >>$tracefile 2>&1
|
|
|
|
cat /proc/cpuinfo >>$tracefile 2>&1
|
2013-04-16 23:59:23 -04:00
|
|
|
env >>$tracefile 2>&1
|
2013-04-16 23:59:17 -04:00
|
|
|
|
|
|
|
# checkout the source dir
|
|
|
|
productbuilddir=$svnbase/$productname
|
2013-04-17 00:00:05 -04:00
|
|
|
|
2013-04-16 23:59:17 -04:00
|
|
|
# cleanup
|
|
|
|
rm -rf $productbuilddir
|
|
|
|
mkdir -p $productbuilddir
|
|
|
|
|
|
|
|
# checkout into $productbuilddir
|
|
|
|
runcmd 0 $productbuilddir retry svn checkout -q -r $revision $svnserver/$checkout . >>$tracefile 2>&1
|
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ $debugtests != 0 ] ; then
|
|
|
|
|
|
|
|
# make debug
|
|
|
|
eval runcmd 0 $productbuilddir make release DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir/utils make -j$makejobs DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir/newbrt/tests make -j$makejobs DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir/src/tests make tests -j$makejobs -k -s SUMMARIZE=1 DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
|
|
|
|
|
|
|
# debug tests
|
|
|
|
eval runcmd 0 $productbuilddir/$system/tests make check -k -s SUMMARIZE=1 DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir/utils make check -k -j$makejobs -s SUMMARIZE=1 DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
|
|
|
|
2013-04-17 00:00:06 -04:00
|
|
|
let n=makejobs; if [ $parallel != 0 ] ; then let n=n/2; fi
|
2013-04-17 00:00:05 -04:00
|
|
|
range_trace=$(my_mktemp range)
|
2013-04-17 00:00:06 -04:00
|
|
|
eval runcmd 0 $productbuilddir/src/range_tree/tests make check -k -j$n -s SUMMARIZE=1 CC=$ftcc DEBUG=1 HAVE_CILK=$have_cilk >>$range_trace 2>&1 $BG
|
2013-04-17 00:00:05 -04:00
|
|
|
lock_trace=$(my_mktemp lock)
|
2013-04-17 00:00:06 -04:00
|
|
|
eval runcmd 0 $productbuilddir/src/lock_tree/tests make check -k -j$n -s SUMMARIZE=1 CC=$ftcc DEBUG=1 HAVE_CILK=$have_cilk >>$lock_trace 2>&1 $BG
|
2013-04-17 00:00:05 -04:00
|
|
|
wait
|
|
|
|
cat $range_trace >>$tracefile; rm $range_trace
|
|
|
|
cat $lock_trace >>$tracefile; rm $lock_trace
|
|
|
|
|
2013-04-17 00:00:06 -04:00
|
|
|
let n=makejobs; if [ $parallel != 0 ] ; then let n=n/2; fi
|
2013-04-17 00:00:05 -04:00
|
|
|
newbrt_trace=$(my_mktemp newbrt)
|
2013-04-17 00:00:06 -04:00
|
|
|
eval runcmd 0 $productbuilddir/newbrt make check -j$n -k -s SUMMARIZE=1 DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$newbrt_trace 2>&1 $BG
|
2013-04-17 00:00:05 -04:00
|
|
|
ydb_trace=$(my_mktemp ydb)
|
2013-04-17 00:00:06 -04:00
|
|
|
eval runcmd 0 $productbuilddir/src/tests make check.tdb -j$n -k -s SUMMARIZE=1 DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$ydb_trace 2>&1 $BG
|
2013-04-17 00:00:05 -04:00
|
|
|
wait
|
|
|
|
cat $newbrt_trace >>$tracefile; rm $newbrt_trace
|
|
|
|
cat $ydb_trace >>$tracefile; rm $ydb_trace
|
|
|
|
|
|
|
|
# benchmark tests
|
|
|
|
eval runcmd 0 $productbuilddir/db-benchmark-test make -k -j$makejobs DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
2013-04-17 00:00:06 -04:00
|
|
|
|
|
|
|
let n=makejobs; if [ $parallel != 0 ] ; then let n=n/3; fi
|
|
|
|
bench_trace=$(my_mktemp bench)
|
|
|
|
eval runcmd 0 $productbuilddir/db-benchmark-test make check -k -j$n -k -s SUMMARIZE=1 DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$bench_trace 2>&1 $BG
|
2013-04-17 00:00:05 -04:00
|
|
|
|
|
|
|
# stress tests
|
|
|
|
stress_trace=$(my_mktemp stress)
|
2013-04-17 00:00:06 -04:00
|
|
|
if [ $stresstests != 0 ] ; then
|
|
|
|
eval runcmd 0 $productbuilddir/src/tests make stress_tests.tdbrun -j$n -k -s SUMMARIZE=1 DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$stress_trace 2>&1 $BG
|
|
|
|
fi
|
2013-04-17 00:00:05 -04:00
|
|
|
drd_trace=$(my_mktemp drd)
|
2013-04-17 00:00:06 -04:00
|
|
|
if [ $drdtests != 0 ] ; then
|
2013-04-17 00:00:13 -04:00
|
|
|
eval runcmd 0 $productbuilddir/src/tests make tiny_stress_tests.drdrun mid_stress_tests.drdrun -j$n -k -s SUMMARIZE=1 DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$drd_trace 2>&1 $BG
|
2013-04-17 00:00:06 -04:00
|
|
|
fi
|
2013-04-17 00:00:05 -04:00
|
|
|
wait
|
2013-04-17 00:00:06 -04:00
|
|
|
cat $bench_trace >>$tracefile; rm $bench_trace
|
2013-04-17 00:00:05 -04:00
|
|
|
cat $stress_trace >>$tracefile; rm $stress_trace
|
2013-04-17 00:00:05 -04:00
|
|
|
cat $drd_trace >>$tracefile; rm $drd_trace
|
2013-04-17 00:00:05 -04:00
|
|
|
|
|
|
|
# upgrade tests
|
|
|
|
if [ $upgradetests != 0 ] ; then
|
|
|
|
runcmd 0 $productbuilddir/src/tests make upgrade-tests.tdbrun -k -s SUMMARIZE=1 DEBUG=1 CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
|
|
|
fi
|
2013-04-16 23:59:17 -04:00
|
|
|
fi
|
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ $releasetests != 0 ] ; then
|
|
|
|
|
|
|
|
# release build
|
|
|
|
eval runcmd 0 $productbuilddir make clean >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir make release CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir/utils make -j$makejobs CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
2013-04-17 00:00:09 -04:00
|
|
|
eval runcmd 0 $productbuilddir/release/examples make check -j$makejobs CC=$ftcc HAVE_CILK=$have_cilk >>$tracefile 2>&1
|
2013-04-17 00:00:05 -04:00
|
|
|
|
|
|
|
# release tests
|
|
|
|
eval runcmd 0 $productbuilddir/$system/tests make check -k -s SUMMARIZE=1 CC=$ftcc HAVE_CILK=$have_cilk VGRIND= >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir/utils make check -k -j$makejobs -s SUMMARIZE=1 CC=$ftcc HAVE_CILK=$have_cilk VGRIND= >>$tracefile 2>&1
|
2013-04-17 00:00:06 -04:00
|
|
|
eval runcmd 0 $productbuilddir/src/range_tree/tests make check -k -j$makejobs -s SUMMARIZE=1 CC=$ftcc HAVE_CILK=$have_cilk VGRIND= >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir/src/lock_tree/tests make check -k -j$makejobs -s SUMMARIZE=1 CC=$ftcc HAVE_CILK=$have_cilk VGRIND= >>$tracefile 2>&1
|
2013-04-17 00:00:05 -04:00
|
|
|
eval runcmd 0 $productbuilddir/newbrt/tests make check -j$makejobs -k -s SUMMARIZE=1 CC=$ftcc HAVE_CILK=$have_cilk VGRIND= >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir/src/tests make check.tdb -j$makejobs -k -s SUMMARIZE=1 CC=$ftcc HAVE_CILK=$have_cilk VGRIND= >>$tracefile 2>&1
|
|
|
|
eval runcmd 0 $productbuilddir/src/tests make stress_tests.tdbrun -j$makejobs -k -s SUMMARIZE=1 CC=$ftcc HAVE_CILK=$have_cilk VGRIND= >>$tracefile 2>&1
|
2013-04-17 00:00:06 -04:00
|
|
|
if [ $bdbtests != 0 ] ; then
|
|
|
|
bdb_trace=$(my_mktemp bdb)
|
|
|
|
eval runcmd 0 $productbuilddir/src/tests make check.bdb -j$makejobs -k -s SUMMARIZE=1 CC=$ftcc HAVE_CILK=$have_cilk VGRIND= >>$bdb_trace 2>&1
|
|
|
|
cat $bdb_trace >>$tracefile; rm $bdb_trace
|
|
|
|
fi
|
2013-04-16 23:59:17 -04:00
|
|
|
fi
|
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
# cilk tests
|
|
|
|
if [ $cilktests != 0 ] ; then
|
|
|
|
runcmd 0 $productbuilddir make clean >>$tracefile 2>&1
|
|
|
|
runcmd 0 $productbuilddir make release CC=$ftcc DEBUG=1 >>$tracefile 2>&1
|
|
|
|
runcmd 0 $productbuilddir/newbrt/tests make cilkscreen_brtloader -k -s SUMMARIZE=1 CC=$ftcc DEBUG=1 >>$tracefile 2>&1
|
|
|
|
fi
|
2013-04-16 23:59:17 -04:00
|
|
|
|
|
|
|
# cxx
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ $cxxtests != 0 ] ; then
|
2013-04-16 23:59:18 -04:00
|
|
|
runcmd $dowindows $productbuilddir/cxx make -k -s >>$tracefile 2>&1
|
|
|
|
runcmd $dowindows $productbuilddir/cxx make -k -s install >>$tracefile 2>&1
|
2013-04-16 23:59:18 -04:00
|
|
|
runcmd $dowindows $productbuilddir/cxx/tests make -k -s check SUMMARIZE=1 >>$tracefile 2>&1
|
2013-04-16 23:59:18 -04:00
|
|
|
runcmd $dowindows $productbuilddir/db-benchmark-test-cxx make -k -s >>$tracefile 2>&1
|
|
|
|
runcmd $dowindows $productbuilddir/db-benchmark-test-cxx make -k -s check >>$tracefile 2>&1
|
2013-04-17 00:00:05 -04:00
|
|
|
fi
|
2013-04-17 00:00:06 -04:00
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
# man
|
|
|
|
if [ 0 = 1 ] ; then
|
|
|
|
runcmd 0 $productbuilddir/man/texi make -k -s -j$makejobs >>$tracefile 2>&1
|
2013-04-16 23:59:17 -04:00
|
|
|
fi
|
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ 0 = 1 -a $docoverage -eq 1 ] ; then
|
2013-04-16 23:59:17 -04:00
|
|
|
# run coverage
|
|
|
|
runcmd 0 $productbuilddir make -s clean >>$tracefile 2>&1
|
|
|
|
runcmd 0 $productbuilddir make build-coverage >>$tracefile 2>&1
|
|
|
|
runcmd 0 $productbuilddir make check-coverage >>$tracefile 2>&1
|
|
|
|
|
|
|
|
# summarize the coverage data
|
2013-04-17 00:00:07 -04:00
|
|
|
coveragefile=$builddir/coverage+$productname-$BDBVERSION+$nodename+$system+$release+$arch
|
2013-04-17 00:00:05 -04:00
|
|
|
rawcoverage=$(my_mktemp ftcover)
|
2013-04-16 23:59:17 -04:00
|
|
|
for d in newbrt src src/range_tree src/lock_tree; do
|
|
|
|
(cd $productbuilddir/$d; python ~/bin/gcovsumdir.py -b *.gcno >>$rawcoverage)
|
|
|
|
if [ -d $productbuilddir/$d/tests ] ; then
|
|
|
|
(cd $productbuilddir/$d/tests; python ~/bin/gcovsumdir.py -b *.gcno >>$rawcoverage)
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
python ~/bin/gcovsumsum.py <$rawcoverage >$coveragefile
|
|
|
|
rm $rawcoverage
|
|
|
|
fi
|
|
|
|
|
|
|
|
# put the trace into svn
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ $commit -ne 0 ] ; then
|
2013-04-17 00:00:08 -04:00
|
|
|
npass=$(egrep "^PASS " $tracefile | wc -l)
|
|
|
|
nfail=$(egrep "^FAIL " $tracefile | wc -l)
|
2013-04-16 23:59:46 -04:00
|
|
|
testresult="PASS=$npass"
|
2013-04-17 00:00:08 -04:00
|
|
|
if [ $nfail != 0 ] ; then testresult="FAIL=$nfail $testresult"; fi
|
2013-04-16 23:59:17 -04:00
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
local cf=$(my_mktemp ftresult)
|
2013-04-17 00:00:07 -04:00
|
|
|
echo "$testresult $productname $ftcc-$GCCVERSION bdb-$BDBVERSION $system $release $arch $nodename" >$cf
|
2013-04-16 23:59:17 -04:00
|
|
|
echo >>$cf; echo >>$cf
|
|
|
|
cat $commit_msg >>$cf
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ $nfail != 0 ] ; then egrep " FAIL" $tracefile >>$cf; fi
|
2013-04-16 23:59:17 -04:00
|
|
|
|
|
|
|
svn add $tracefile $coveragefile
|
|
|
|
retry svn commit -F "$cf" $tracefile $coveragefile
|
|
|
|
rm $cf
|
|
|
|
else
|
|
|
|
cat $commit_msg
|
|
|
|
fi
|
2013-04-17 00:00:05 -04:00
|
|
|
rm $commit_msg
|
2013-04-16 23:59:38 -04:00
|
|
|
|
|
|
|
return 0
|
2013-04-16 23:59:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# set defaults
|
|
|
|
exitcode=0
|
|
|
|
svnserver=https://svn.tokutek.com/tokudb
|
2013-04-17 00:00:06 -04:00
|
|
|
nodename=$(uname -n)
|
|
|
|
system=$(uname -s | tr '[:upper:]' '[:lower:]' | sanitize)
|
|
|
|
release=$(uname -r | sanitize)
|
|
|
|
arch=$(uname -m | sanitize)
|
|
|
|
date=$(date +%Y%m%d)
|
|
|
|
branch=.
|
|
|
|
tokudb=tokudb
|
2013-04-17 00:00:07 -04:00
|
|
|
bdb=5.3
|
2013-04-17 00:00:14 -04:00
|
|
|
ncpus=$(get_ncpus)
|
|
|
|
toku_ncpus=8
|
|
|
|
makejobs=$ncpus
|
2013-04-16 23:59:17 -04:00
|
|
|
revision=0
|
2013-04-17 00:00:05 -04:00
|
|
|
VALGRIND=tokugrind
|
|
|
|
commit=1
|
2013-04-16 23:59:17 -04:00
|
|
|
docoverage=0
|
2013-04-17 00:00:05 -04:00
|
|
|
ftcc=gcc
|
|
|
|
have_cilk=0
|
2013-04-17 00:00:09 -04:00
|
|
|
have_poly=0
|
2013-04-17 00:00:05 -04:00
|
|
|
debugtests=1
|
|
|
|
releasetests=1
|
|
|
|
upgradetests=0
|
2013-04-17 00:00:06 -04:00
|
|
|
stresstests=1
|
|
|
|
drdtests=1
|
2013-04-17 00:00:05 -04:00
|
|
|
cilktests=0
|
|
|
|
cxxtests=0
|
|
|
|
parallel=0
|
2013-04-17 00:00:06 -04:00
|
|
|
bdbtests=1
|
2013-04-16 23:59:17 -04:00
|
|
|
|
|
|
|
while [ $# -gt 0 ] ; do
|
|
|
|
arg=$1; shift
|
2013-04-17 00:00:05 -04:00
|
|
|
if [[ $arg =~ ^--(.*)=(.*) ]] ; then
|
2013-04-16 23:59:17 -04:00
|
|
|
eval ${BASH_REMATCH[1]}=${BASH_REMATCH[2]}
|
|
|
|
else
|
|
|
|
usage; exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
# setup intel compiler env
|
|
|
|
if [ $ftcc = icc ] ; then
|
2013-04-16 23:59:47 -04:00
|
|
|
d=/opt/intel/bin
|
|
|
|
if [ -d $d ] ; then
|
|
|
|
export PATH=$d:$PATH
|
|
|
|
. $d/compilervars.sh intel64
|
|
|
|
fi
|
|
|
|
d=/opt/intel/cilkutil/bin
|
|
|
|
if [ -d $d ] ; then
|
|
|
|
export PATH=$d:$PATH
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-04-16 23:59:17 -04:00
|
|
|
if [ $branch = "." ] ; then branch="toku"; fi
|
2013-04-17 00:00:06 -04:00
|
|
|
if [ $revision -eq 0 ] ; then revision=$(get_latest_svn_revision); fi
|
2013-04-17 00:00:05 -04:00
|
|
|
if [ $parallel -ne 0 ] ; then BG="&"; fi
|
2013-04-16 23:59:17 -04:00
|
|
|
|
2013-04-16 23:59:36 -04:00
|
|
|
# setup GCCVERSION
|
2013-04-17 00:00:06 -04:00
|
|
|
export GCCVERSION=$($ftcc --version|head -1|cut -f3 -d" ")
|
2013-04-16 23:59:39 -04:00
|
|
|
export VALGRIND=$VALGRIND
|
2013-04-16 23:59:36 -04:00
|
|
|
|
2013-04-17 00:00:14 -04:00
|
|
|
# setup TOKU_NCPUS
|
|
|
|
if [ -z "$TOKU_NCPUS" -a $toku_ncpus -le $ncpus ] ; then export TOKU_NCPUS=$toku_ncpus; fi
|
|
|
|
|
2013-04-17 00:00:05 -04:00
|
|
|
# limit execution time to 3 hours
|
|
|
|
let t=3*3600
|
|
|
|
ulimit -t $t
|
|
|
|
ulimit -c unlimited
|
2013-04-16 23:59:17 -04:00
|
|
|
|
2013-04-16 23:59:41 -04:00
|
|
|
build $bdb
|