added: make target to run regression tests on commits on top of trunk

git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@1971 e10b68d5-8a6e-419e-a041-bce267b0401d
This commit is contained in:
akva 2012-10-15 09:21:26 +00:00 committed by Knut Morten Okstad
parent d77067bd2a
commit ea10e44c5b
3 changed files with 113 additions and 19 deletions

View File

@ -91,6 +91,20 @@ ADD_CUSTOM_TARGET(doc doxygen
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generating API documentation" VERBATIM)
# For testing commits
ADD_CUSTOM_TARGET(check-commits scripts/check-patchseries.sh
"${CMAKE_BUILD_TYPE}" "."
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Checking commits" VERBATIM)
ADD_CUSTOM_TARGET(check-commits-all scripts/check-patchseries.sh
"${CMAKE_BUILD_TYPE}" "."
"Apps/FSWallDistance"
"Apps/Elasticity/FiniteDeformation"
"Apps/Stokes"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Checking commits" VERBATIM)
# Regression tests
IF(IFEM_USE_PARALLEL_PETSC)
# Add parallel tests for LinEl / Poisson here

31
scripts/check-patchseries.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
# check-patchseries.sh
# Arne Morten Kvarving / SINTEF
# Oct 2012
# Convenience script that compiles and runs regression tests
# for a series of commits. Use the CHECK_BASE enviroment variable
# to control the base of the series. It then checks the revisions
# between the base and HEAD of the current branch
# Params: See doregtests.sh
#
# Assumes it it is run from top of the source tree
# and that the script sits in the 'scripts' directory
# directly off the top of the tree.
branch=`git branch|grep \*|awk -F ' ' '{print $2}'`
base=$CHECK_BASE
test -z $base && base=trunk
for rev in `git rev-list $base..HEAD --reverse`; do
git checkout $rev
if ! scripts/doregtests.sh $@
then
echo "Something failed for rev $rev"
git checkout $branch
exit 1
fi
done
git checkout $branch
echo "Everything checks out."

View File

@ -1,33 +1,82 @@
#!/bin/bash
# Convenience script that compiles and runs all regression tests
# doregtest.sh
# Arne Morten Kvarving / SINTEF
# Oct 2012
# Convenience script that compiles and runs regression tests
# Params: $1 - build configuration
# Params: $2..$@ - directories to run tests in
#
# Assumes it it is run from top of the source tree
# and that the script sits in the 'scripts' directory
# directly off the top of the tree.
# Configure and build a directory
# Params: $1 - configuration directory
# $2 - root configuration directory
# $3 - directory to configure for
Build() {
if ! test -d $1
then
# Copy config off root dir
config=`cmake -L $2|grep =`
cmakeopt=""
IFS=$'\n'
for line in $config; do
opt=`echo $line | sed -e 's/=/="/g' -e 's/$/"/g'`
cmakeopt="-D$opt $cmakeopt"
done
mkdir $1
cd $1
cmake $3 $cmakeopt
else
# Make sure build system is up to date
cd $1
cmake $3
fi
if ! make -j3
then
globres=1
return
fi
}
globres=0
ROOT=`readlink -f $0`
ROOT=`dirname $ROOT`/..
PATHS=". Apps/Stokes Apps/FiniteDefElasticity"
rm -f $ROOT/failed.log
globres=0
for p in $PATHS
do
cd $ROOT/$p
mkdir Release-Testing
cd Release-Testing
cmake $ROOT/$p -DDISABLE_HDF5=1 -DCMAKE_BUILD_TYPE=Release -DIFEM_BUILD_TYPE=Release-Testing
make -j3
if ! make test
then
globres=1
fi
done
# Build root lib
rootconfig=$ROOT/$1
test -d $rootconfig || rootconfig=$ROOT
cd $rootconfig
Build $rootconfig $rootconfig $ROOT
if test $globres -eq 0
then
for param in ${@:2}; do
test -d $ROOT/$1 && builddir=$ROOT/$param/$1
test -d $ROOT/$1 || builddir=$ROOT/$param
if [ "$param" != "." ]
then
Build $builddir $rootconfig $ROOT/$param
fi
if test $globres -eq 0
then
if ! make test
then
globres=1
fi
fi
done
fi
if test $globres -eq 1
then
echo "Some tests failed, see failed.log in root of repository for details"
fi
for p in $PATHS
do
rm $ROOT/$p/Release-Testing -rf
done
exit $globres