Skip to content
Snippets Groups Projects
Commit af20d1dc authored by Jean-Baptiste Keck's avatar Jean-Baptiste Keck
Browse files

added a custom target to launch continuous integration tests: make ci

parent e831d8ec
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
set -e set -e
if [ $# -ne 3 ]; then if [ $# -lt 2 ]; then
echo "Usage ./test install_folder hysop_folder cache_dir" echo "Usage ./test install_folder hysop_folder [cache_dir]"
exit 1
fi
if [ $# -gt 3 ]; then
echo "Usage ./test install_folder hysop_folder [cache_dir]"
exit 1 exit 1
fi fi
...@@ -18,18 +23,25 @@ fi ...@@ -18,18 +23,25 @@ fi
INSTALL_DIR=$1 INSTALL_DIR=$1
HYSOP_DIR=$2 HYSOP_DIR=$2
CACHE_DIR=$3 if [ $# -eq 3 ]; then
CACHE_DIR=$3
if [ -d "$CACHE_DIR" ]; then HAS_CACHE_DIR=true
echo "Cache directory '$CACHE_DIR' was found."
mkdir -p /root/.cache
cp -r $CACHE_DIR/* /root/.cache
else else
echo "Cache directory '$CACHE_DIR' was not found." HAS_CACHE_DIR=false
mkdir -p $CACHE_DIR
fi fi
export PYTHONPATH="$INSTALL_DIR/lib/python2.7/site-packages" if [ "$HAS_CACHE_DIR" = true ]; then
if [ -d "$CACHE_DIR" ]; then
echo "Cache directory '$CACHE_DIR' was found."
mkdir -p /root/.cache
cp -r $CACHE_DIR/* /root/.cache
else
echo "Cache directory '$CACHE_DIR' was not found."
mkdir -p $CACHE_DIR
fi
fi
export PYTHONPATH="$INSTALL_DIR/lib/python2.7/site-packages:$PYTHONPATH"
python -c 'import hysop; print hysop' python -c 'import hysop; print hysop'
# long backend dependent tests # long backend dependent tests
...@@ -49,7 +61,9 @@ python "$HYSOP_DIR/operator/tests/test_directional_advection.py" ...@@ -49,7 +61,9 @@ python "$HYSOP_DIR/operator/tests/test_directional_advection.py"
python "$HYSOP_DIR/operator/tests/test_directional_diffusion.py" python "$HYSOP_DIR/operator/tests/test_directional_diffusion.py"
python "$HYSOP_DIR/operator/tests/test_directional_stretching.py" python "$HYSOP_DIR/operator/tests/test_directional_stretching.py"
cp -r /root/.cache/* $CACHE_DIR/ if [ "$HAS_CACHE_DIR" = true ]; then
find $CACHE_DIR -name '*.lock' -delete cp -r /root/.cache/* $CACHE_DIR/
find $CACHE_DIR -name '*.lock' -delete
fi
exit 0 exit 0
...@@ -96,3 +96,6 @@ foreach(testfile ${py_doctest_files}) ...@@ -96,3 +96,6 @@ foreach(testfile ${py_doctest_files})
add_test("doctest_${testName}" py.test -v --doctest-modules ${exename}) add_test("doctest_${testName}" py.test -v --doctest-modules ${exename})
endforeach() endforeach()
# Add custom target to launch continuous integration tests
add_custom_target(ci COMMAND ${CMAKE_SOURCE_DIR}/ci/scripts/test.sh ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/hysop)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment