Files
openmesh/CI/ci-linux.sh

139 lines
3.4 KiB
Bash
Raw Normal View History

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-12-15 11:00:30 +01:00
MAKE_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-12-15 11:00:30 +01:00
# without icecc: no options required
OPTIONS="-DCMAKE_CXX_COMPILER=/usr/lib/icecc/bin/g++ -DCMAKE_C_COMPILER=/usr/lib/icecc/bin/gcc"
MAKE_OPTIONS="-j16"
export ICECC_CXX=/usr/bin/g++ ; export ICECC_CC=/usr/bin/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"
elif [ "$LANGUAGE" == "C++14" ]; then
echo "Building with C++14";
OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++14' "
BUILDPATH="$BUILDPATH-cpp14"
2015-11-11 10:02:42 +01:00
fi
2015-12-03 10:58:00 +01:00
#=====================================
# Color Settings:
#=====================================
NC='\033[0m'
OUTPUT='\033[0;32m'
WARNING='\033[0;93m'
2015-11-11 10:02:42 +01:00
2015-12-03 10:58:00 +01:00
2016-05-12 12:34:55 +02:00
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Basic configuration details:"
echo "======================================================================"
echo -e "${NC}"
echo "Compiler: $COMPILER"
echo "Options: $OPTIONS"
echo "Language: $LANGUAGE"
echo "Make Options: $OPTIONS"
echo "BuildPath: $BUILDPATH"
echo "Path: $PATH"
echo "Language: $LANGUAGE"
echo -e "${OUTPUT}"
2015-12-03 10:42:32 +01:00
echo ""
echo "======================================================================"
echo "Building Release version with vectorchecks enabled"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
if [ ! -d build-release-$BUILDPATH-Vector-Checks ]; then
mkdir build-release-$BUILDPATH-Vector-Checks
2015-11-11 10:02:42 +01:00
fi
cd build-release-$BUILDPATH-Vector-Checks
2015-11-11 10:02:42 +01:00
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
2015-11-11 10:02:42 +01:00
#build it
2015-12-15 11:00:30 +01:00
make $MAKE_OPTIONS
2015-11-11 10:02:42 +01:00
#build the unit tests
2015-12-15 11:00:30 +01:00
make $MAKE_OPTIONS unittests
2015-11-11 10:02:42 +01:00
echo -e "${OUTPUT}"
2015-12-03 10:42:32 +01:00
echo ""
echo "======================================================================"
echo "Running unittests Release version with vectorchecks enabled"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
2015-11-11 10:02:42 +01:00
cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
cd ..
cd ..
echo -e "${OUTPUT}"
2015-12-03 10:42:32 +01:00
echo ""
echo "======================================================================"
echo "Building Debug version with vectorchecks enabled"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
if [ ! -d build-debug-$BUILDPATH-Vector-Checks ]; then
mkdir build-debug-$BUILDPATH-Vector-Checks
2015-11-11 10:02:42 +01:00
fi
cd build-debug-$BUILDPATH-Vector-Checks
2015-11-11 10:02:42 +01:00
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
2015-11-11 10:02:42 +01:00
#build it
2015-12-15 11:00:30 +01:00
make $MAKE_OPTIONS
2015-11-11 10:02:42 +01:00
#build the unit tests
2015-12-15 11:00:30 +01:00
make $MAKE_OPTIONS unittests
2015-11-11 10:02:42 +01:00
echo -e "${OUTPUT}"
2015-12-03 10:42:32 +01:00
echo ""
echo "======================================================================"
echo "Running unittests Debug version with vectorchecks enabled"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
2015-11-11 10:02:42 +01:00
cd Unittests
#execute tests
2015-11-11 10:02:42 +01:00
./unittests --gtest_color=yes --gtest_output=xml
cd ..
cd ..