Files
openmesh/CI/ci-mac.sh

229 lines
5.3 KiB
Bash
Raw Normal View History

#!/bin/bash
2015-11-25 14:42:58 +01:00
#Exit on any error
2015-12-03 10:45:01 +01:00
set -e
2015-11-25 14:42:58 +01:00
2015-11-11 15:12:19 +01:00
LANGUAGE=$1
2015-12-03 10:58:00 +01:00
2015-11-11 14:31:32 +01:00
PATH=$PATH:/opt/local/bin
export PATH
2015-11-11 15:12:19 +01:00
OPTIONS=""
if [ "$LANGUAGE" == "C++98" ]; then
echo "Building with C++98";
BUILDPATH="cpp98"
2015-11-11 15:12:19 +01:00
elif [ "$LANGUAGE" == "C++11" ]; then
echo "Building with C++11";
OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
BUILDPATH="cpp11"
elif [ "$LANGUAGE" == "C++14" ]; then
echo "Building with C++14";
OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++14' "
BUILDPATH="cpp14"
2015-12-03 10:45:01 +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 15:12:19 +01:00
2015-12-03 10:58:00 +01:00
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Basic configuration details:"
echo "======================================================================"
echo -e "${NC}"
echo "Options: $OPTIONS"
echo "BuildPath: $BUILDPATH"
echo "Path: $PATH"
echo "Language: $LANGUAGE"
echo -e "${OUTPUT}"
2015-12-03 10:45:01 +01:00
echo ""
echo "======================================================================"
echo "Building Release version with vectorchecks enabled"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
2015-11-11 15:12:19 +01:00
2015-12-03 10:45:01 +01:00
if [ ! -d build-release-$BUILDPATH-Vector-Checks ]; then
mkdir build-release-$BUILDPATH-Vector-Checks
fi
2015-12-03 10:45:01 +01:00
cd build-release-$BUILDPATH-Vector-Checks
2015-12-03 10:45:01 +01:00
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../
#build it
make
#build the unit tests
make unittests
echo -e "${OUTPUT}"
2015-12-03 10:45:01 +01:00
echo ""
echo "======================================================================"
echo "Running unittests Release version with vectorchecks enabled"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
2015-11-26 12:20:12 +01:00
cd ..
2015-12-03 10:45:01 +01:00
cd ..
echo -e "${OUTPUT}"
2015-12-03 10:45:01 +01:00
echo ""
echo "======================================================================"
echo "Building Release version with vectorchecks disabled for python tests"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
2015-12-03 10:45:01 +01:00
if [ ! -d build-release-$BUILDPATH ]; then
mkdir build-release-$BUILDPATH
fi
cd build-release-$BUILDPATH
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF -DCPACK_BINARY_DRAGNDROP=ON $OPTIONS ../
2015-12-03 10:45:01 +01:00
#build it
make
echo -e "${OUTPUT}"
2015-12-03 10:45:01 +01:00
echo ""
echo "======================================================================"
echo "Running Python unittests Release version "
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
2015-12-03 10:45:01 +01:00
2015-12-15 10:32:16 +01:00
if [ "$LANGUAGE" == "C++11" ]; then
# Execute Python unittests
cd Python-Unittests
rm -f openmesh.so
cp ../Build/python/openmesh.so .
python -m unittest discover -v
cd ..
else
echo -e "${WARNING}"
2015-12-15 10:32:16 +01:00
echo "WARNING! Python unittests disabled for clang on Mac with c++98 !!"
echo -e "${NC}"
2015-12-15 10:32:16 +01:00
fi
2015-11-25 16:09:22 +01:00
cd ..
echo -e "${OUTPUT}"
2015-12-03 10:45:01 +01:00
echo ""
echo "======================================================================"
echo "Building Debug version with vectorchecks enabled"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
2015-12-03 10:45:01 +01:00
if [ ! -d build-debug-$BUILDPATH-Vector-Checks ]; then
mkdir build-debug-$BUILDPATH-Vector-Checks
fi
2015-12-03 10:45:01 +01:00
cd build-debug-$BUILDPATH-Vector-Checks
2015-12-03 10:45:01 +01:00
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../
2015-11-26 12:20:12 +01:00
#build it
make
#build the unit tests
make unittests
echo -e "${OUTPUT}"
2015-12-03 10:45:01 +01:00
echo ""
echo "======================================================================"
echo "Running unittests Debug version with vectorchecks enabled"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
cd Unittests
2015-12-03 10:45:01 +01:00
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
2015-11-26 12:20:12 +01:00
cd ..
2015-12-03 10:45:01 +01:00
cd ..
echo -e "${OUTPUT}"
2015-12-03 10:45:01 +01:00
echo ""
echo "======================================================================"
echo "Building Debug version with vectorchecks disabled for python tests"
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
2015-12-03 10:45:01 +01:00
if [ ! -d build-debug-$BUILDPATH ]; then
mkdir build-debug-$BUILDPATH
fi
cd build-debug-$BUILDPATH
cmake -DCMAKE_BUILD_TYPE=DEBUG -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../
#build it
make
echo -e "${OUTPUT}"
2015-12-03 10:45:01 +01:00
echo ""
echo "======================================================================"
echo "Running Python unittests Debug version "
2015-12-03 10:58:00 +01:00
echo "======================================================================"
echo -e "${NC}"
2015-12-03 10:45:01 +01:00
if [ "$LANGUAGE" == "C++11" ]; then
2015-11-26 12:20:12 +01:00
2015-12-15 10:32:16 +01:00
# Execute Python unittests
cd Python-Unittests
2015-12-15 10:32:16 +01:00
rm -f openmesh.so
cp ../Build/python/openmesh.so .
python -m unittest discover -v
cd ..
else
echo -e "${WARNING}"
echo "WARNING! Python unittests disabled for clang on Mac with c++98 !!"
echo -e "${NC}"
fi
cd ..
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
2016-05-12 12:31:50 +02:00
echo "Package creation (DMG and tarball)"
echo "======================================================================"
echo -e "${NC}"
cd build-release-$BUILDPATH
cp ../build-debug-$BUILDPATH/Build/lib/* ./Build/lib/
cmake .
make package