2015-11-11 10:02:42 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
COMPILER=$1
|
|
|
|
|
LANGUAGE=$2
|
|
|
|
|
|
2015-11-25 12:00:41 +01:00
|
|
|
# Exit script on any error
|
|
|
|
|
set -e
|
|
|
|
|
|
2015-11-11 10:02:42 +01:00
|
|
|
OPTIONS=""
|
2015-11-26 12:20:39 +01:00
|
|
|
BUILDPATH=""
|
2015-11-11 10:02:42 +01:00
|
|
|
|
|
|
|
|
if [ "$COMPILER" == "gcc" ]; then
|
|
|
|
|
echo "Building with GCC";
|
2015-11-26 12:20:39 +01:00
|
|
|
BUILDPATH="gcc"
|
2015-11-11 10:02:42 +01:00
|
|
|
elif [ "$COMPILER" == "clang" ]; then
|
|
|
|
|
|
|
|
|
|
OPTIONS="$OPTIONS -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
|
|
|
|
|
echo "Building with CLANG";
|
2015-11-26 12:20:39 +01:00
|
|
|
BUILDPATH="clang"
|
2015-11-11 10:02:42 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$LANGUAGE" == "C++98" ]; then
|
|
|
|
|
echo "Building with C++98";
|
2015-11-26 12:20:39 +01:00
|
|
|
BUILDPATH="$BUILDPATH-cpp98"
|
2015-11-11 10:02:42 +01:00
|
|
|
elif [ "$LANGUAGE" == "C++11" ]; then
|
|
|
|
|
echo "Building with C++11";
|
|
|
|
|
OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
|
2015-11-26 12:20:39 +01:00
|
|
|
BUILDPATH="$BUILDPATH-cpp11"
|
2015-11-11 10:02:42 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#########################################
|
|
|
|
|
|
|
|
|
|
# Make release build folder
|
2015-11-26 12:20:39 +01:00
|
|
|
if [ ! -d build-release-$BUILDPATH ]; then
|
|
|
|
|
mkdir build-release-$BUILDPATH
|
2015-11-11 10:02:42 +01:00
|
|
|
fi
|
|
|
|
|
|
2015-11-26 12:20:39 +01:00
|
|
|
cd build-release-$BUILDPATH
|
2015-11-11 10:02:42 +01:00
|
|
|
|
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../
|
|
|
|
|
|
|
|
|
|
#build it
|
|
|
|
|
make
|
|
|
|
|
|
|
|
|
|
#build the unit tests
|
|
|
|
|
make unittests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#########################################
|
|
|
|
|
# Run Release Unittests
|
|
|
|
|
#########################################
|
|
|
|
|
cd Unittests
|
|
|
|
|
|
|
|
|
|
#execute tests
|
|
|
|
|
./unittests --gtest_color=yes --gtest_output=xml
|
|
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
|
# Execute Python unittests
|
|
|
|
|
cd Python-Unittests
|
2015-11-30 13:24:12 +01:00
|
|
|
python -m unittest discover -v
|
2015-11-11 10:02:42 +01:00
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#########################################
|
|
|
|
|
# Build Debug version and Unittests
|
|
|
|
|
#########################################
|
|
|
|
|
|
2015-11-26 12:20:39 +01:00
|
|
|
if [ ! -d build-debug-$BUILDPATH ]; then
|
|
|
|
|
mkdir build-debug-$BUILDPATH
|
2015-11-11 10:02:42 +01:00
|
|
|
fi
|
|
|
|
|
|
2015-11-26 12:20:39 +01:00
|
|
|
cd build-debug-$BUILDPATH
|
2015-11-11 10:02:42 +01:00
|
|
|
|
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../
|
|
|
|
|
|
2015-11-30 13:24:12 +01:00
|
|
|
#build it
|
|
|
|
|
make
|
|
|
|
|
|
2015-11-11 10:02:42 +01:00
|
|
|
#build the unit tests
|
|
|
|
|
make unittests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#########################################
|
|
|
|
|
# Run Debug Unittests
|
|
|
|
|
#########################################
|
|
|
|
|
|
|
|
|
|
cd Unittests
|
|
|
|
|
|
|
|
|
|
# Run the unittests
|
|
|
|
|
./unittests --gtest_color=yes --gtest_output=xml
|
|
|
|
|
|
2015-11-30 13:24:12 +01:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
|
# Execute Python unittests
|
|
|
|
|
cd Python-Unittests
|
|
|
|
|
python -m unittest discover -v
|
|
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
cd ..
|
2015-11-11 10:02:42 +01:00
|
|
|
|