changed: move helper scripts to a scripts folder in root
git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@1564 e10b68d5-8a6e-419e-a041-bce267b0401d
This commit is contained in:
parent
6b149d120b
commit
e4ac10a772
|
@ -169,7 +169,7 @@ ADD_CUSTOM_TARGET(doc doxygen
|
|||
|
||||
FILE(GLOB_RECURSE NONLINEL_TESTFILES "${PROJECT_SOURCE_DIR}/Test/*.reg")
|
||||
FOREACH(TESTFILE ${NONLINEL_TESTFILES})
|
||||
ADD_TEST(${TESTFILE} ${PROJECT_SOURCE_DIR}/../../test/regtest.sh "${CMAKE_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}/NonLinEl" "${TESTFILE}")
|
||||
ADD_TEST(${TESTFILE} ${PROJECT_SOURCE_DIR}/../../scripts/regtest.sh "${CMAKE_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}/NonLinEl" "${TESTFILE}")
|
||||
ENDFOREACH()
|
||||
|
||||
IF(NOT IFEM_INSTALL_PREFIX)
|
||||
|
|
|
@ -200,12 +200,12 @@ ADD_CUSTOM_TARGET(doc doxygen
|
|||
# Regression tests
|
||||
FILE(GLOB_RECURSE LINEL_TESTFILES "${PROJECT_SOURCE_DIR}/Apps/LinearElasticity/Test/*.reg")
|
||||
FOREACH(TESTFILE ${LINEL_TESTFILES})
|
||||
ADD_TEST(${TESTFILE} ${PROJECT_SOURCE_DIR}/test/regtest.sh "${CMAKE_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}/LinEl" "${TESTFILE}")
|
||||
ADD_TEST(${TESTFILE} ${PROJECT_SOURCE_DIR}/scripts/regtest.sh "${CMAKE_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}/LinEl" "${TESTFILE}")
|
||||
ENDFOREACH()
|
||||
|
||||
FILE(GLOB_RECURSE POISSON_TESTFILES "${PROJECT_SOURCE_DIR}/Apps/Poisson/Test/*.reg")
|
||||
FOREACH(TESTFILE ${POISSON_TESTFILES})
|
||||
ADD_TEST(${TESTFILE} ${PROJECT_SOURCE_DIR}/test/regtest.sh "${CMAKE_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}/Poisson" "${TESTFILE}")
|
||||
ADD_TEST(${TESTFILE} ${PROJECT_SOURCE_DIR}/scripts/regtest.sh "${CMAKE_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}/Poisson" "${TESTFILE}")
|
||||
ENDFOREACH()
|
||||
|
||||
IF(NOT IFEM_INSTALL_PREFIX)
|
||||
|
|
33
scripts/doregtests.sh
Executable file
33
scripts/doregtests.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Convenience script that compiles and runs all regression tests
|
||||
|
||||
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
|
||||
|
||||
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
|
49
scripts/regtest.sh
Executable file
49
scripts/regtest.sh
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script performs a single regression.
|
||||
# It is used by the 'make test' target in the buildsystems
|
||||
# Usually you should use 'make test' rather than calling this script directly
|
||||
#
|
||||
# Parameters: $1 = Application binary
|
||||
# $2 = Regression test file
|
||||
#
|
||||
# A regression test file is of the format:
|
||||
# parameters to application
|
||||
# blank line
|
||||
# output from program to compare to
|
||||
|
||||
mysim=$1
|
||||
|
||||
cd `dirname $2`
|
||||
readarray < $2
|
||||
$mysim $MAPFILE 2>&1 > templog
|
||||
globres=1
|
||||
IFS=$'\n'
|
||||
for line in `cat $2`
|
||||
do
|
||||
test -z "$line" && continue
|
||||
echo "$line" | grep -q ".inp" && continue
|
||||
result=0
|
||||
if grep -q "$line" templog
|
||||
then result=1
|
||||
fi
|
||||
if test $result -eq 0
|
||||
then
|
||||
if test $globres -eq 1
|
||||
then
|
||||
echo "-------- $2 --------" >> ../../../failed.log
|
||||
fi
|
||||
globres=0
|
||||
echo Failed to find output: $line >> ../../../failed.log
|
||||
fi
|
||||
done
|
||||
|
||||
if test $globres -eq 0
|
||||
then
|
||||
cat templog >> ../../../failed.log
|
||||
rm templog
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm templog
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user