Skip to content

Commit

Permalink
added ctest support and run it in testsuite #3 and #4
Browse files Browse the repository at this point in the history
  • Loading branch information
prudhomm committed Jul 19, 2017
1 parent 176fc4e commit a2332f3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 38 deletions.
64 changes: 27 additions & 37 deletions feelpp-env/feelpp.conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,43 +85,6 @@ install_feelpp_libs()
return $exit_status
}

#
# Feel++ Base
configure_feelpp_base()
{
cd $HOME
cd ${FEELPP_BUILD_DIR}/
if [[ $CXXFLAGS ]]; then
${FEELPP_SRC_DIR}/feelpp/quickstart/configure -r --root="${FEELPP_SRC_DIR}/feelpp/quickstart" --cxxflags="${CXXFLAGS}" --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
else
${FEELPP_SRC_DIR}/feelpp/quickstart/configure -r --root="${FEELPP_SRC_DIR}/feelpp/quickstart" --cmakeflags="-DCMAKE_INSTALL_PREFIX=${FEELPP_HOME} $*";
fi
}

build_feelpp_base()
{
echo "Building Feel++ Libs..."
if [ -d ${FEELPP_SRC_DIR}/feelpp ]
then
# Get the number of jobs to be used
NJOBS=${1:-${DEFAULT_NJOBS}}
shift
# $* now contains possible additional cmake flags
configure_feelpp_base ${@:2}
sudo make -j $NJOBS install-feelpp-base
else
echo "Feel++ source cannot be found. Please run pull_feelpp first."
fi
}

# install_feelpp_base <NJOBS:1>
install_feelpp_base()
{
build_feelpp_base ${1:-${DEFAULT_NJOBS}} ${*:2}
clean_feelpp
}


#
# Feel++ module
configure_feelpp_module()
Expand Down Expand Up @@ -167,6 +130,22 @@ build_feelpp_module()
return $exit_status
}

# <module name> <module path> <jobs>
ctest_feelpp_module()
{
exit_status=0
echo "--- CTesting Feel++ Module ${2}..."
if [ -d ${FEELPP_SRC_DIR}/feelpp ]
then
ctest -R . -j ${3}
((exit_status=$exit_status || $?));
else
echo "Feel++ source cannot be found. Please run pull_feelpp first then build_feelpp_module"
fi
echo -e "\033[33;32m--- CTesting Feel++ ${MODULE} done. \033[0m"
return $exit_status
}

# install_feelpp_module <module name> <module path> options <NJOBS:1> <cmake flags>
install_feelpp_module()
{
Expand All @@ -177,3 +156,14 @@ install_feelpp_module()
((exit_status=$exit_status || $?));
return $exit_status
}
install_test_feelpp_module()
{
exit_status=0
build_feelpp_module ${1} ${2} ${3} ${4:-${DEFAULT_NJOBS}} ${*:5}
((exit_status=$exit_status || $?));
ctest_feelpp_module ${1} ${2} 4
((exit_status=$exit_status || $?));
clean_feelpp
((exit_status=$exit_status || $?));
return $exit_status
}
2 changes: 1 addition & 1 deletion feelpp-testsuite/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ USER feelpp
ENV HOME /home/feelpp

# Install Feel++
RUN bash -c "source $HOME/feelpp.conf.sh && install_feelpp_module ${BRANCH} testsuite $HOME/src/feelpp/testsuite ${BUILD_JOBS} ${CMAKE_FLAGS}"
RUN bash -c "source $HOME/feelpp.conf.sh && install_test_feelpp_module ${BRANCH} testsuite $HOME/src/feelpp/testsuite ${BUILD_JOBS} ${CMAKE_FLAGS}"

COPY WELCOME $HOME/WELCOME.testsuite

Expand Down

0 comments on commit a2332f3

Please sign in to comment.