Commit 3454c688 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'OM6.0-with-python' into 'master'

Om6.0 with python

Merge with some disabled python tests in ci


See merge request !36
parents 74f0f236 512bc07f
Pipeline #403 passed with stage
......@@ -7,11 +7,18 @@ LANGUAGE=$2
set -e
OPTIONS=""
MAKE_OPTIONS=""
BUILDPATH=""
if [ "$COMPILER" == "gcc" ]; then
echo "Building with GCC";
BUILDPATH="gcc"
# 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
elif [ "$COMPILER" == "clang" ]; then
OPTIONS="$OPTIONS -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
......@@ -28,65 +35,169 @@ elif [ "$LANGUAGE" == "C++11" ]; then
BUILDPATH="$BUILDPATH-cpp11"
fi
#########################################
#=====================================
# Color Settings:
#=====================================
NC='\033[0m'
OUTPUT='\033[0;32m'
WARNING='\033[0;93m'
# Make release build folder
if [ ! -d build-release-$BUILDPATH ]; then
mkdir build-release-$BUILDPATH
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Release version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
if [ ! -d build-release-$BUILDPATH-Vector-Checks ]; then
mkdir build-release-$BUILDPATH-Vector-Checks
fi
cd build-release-$BUILDPATH
cd build-release-$BUILDPATH-Vector-Checks
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_BINDINGS=OFF $OPTIONS ../
#build it
make
make $MAKE_OPTIONS
#build the unit tests
make unittests
make $MAKE_OPTIONS unittests
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Release version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
#########################################
# Run Release Unittests
#########################################
cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
cd ..
cd ..
# Execute Python unittests
cd Python-Unittests
#python -m unittest discover -v
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Release version with vectorchecks disabled for python tests"
echo "======================================================================"
echo -e "${NC}"
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 $OPTIONS ../
#build it
make $MAKE_OPTIONS
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running Python unittests Release version "
echo "======================================================================"
echo -e "${NC}"
if [ "$LANGUAGE" == "C++11" ] || [ "$COMPILER" == "gcc" ] ; then
# Execute Python unittests
cd Python-Unittests
python -m unittest discover -v
cd ..
else
echo -e "${WARNING}"
echo "WARNING! Python unittests disabled !!"
echo -e "${NC}"
fi
cd ..
cd ..
#########################################
# Build Debug version and Unittests
#########################################
if [ ! -d build-debug-$BUILDPATH ]; then
mkdir build-debug-$BUILDPATH
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Debug version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
if [ ! -d build-debug-$BUILDPATH-Vector-Checks ]; then
mkdir build-debug-$BUILDPATH-Vector-Checks
fi
cd build-debug-$BUILDPATH
cd build-debug-$BUILDPATH-Vector-Checks
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_BINDINGS=OFF $OPTIONS ../
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../
#build it
make $MAKE_OPTIONS
#build the unit tests
make unittests
make $MAKE_OPTIONS unittests
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Debug version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
#########################################
# Run Debug Unittests
#########################################
cd Unittests
# Run the unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
cd ..
cd ..
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Debug version with vectorchecks disabled for python tests"
echo "======================================================================"
echo -e "${NC}"
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 $MAKE_OPTIONS
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running Python unittests Debug version "
echo "======================================================================"
echo -e "${NC}"
if [ "$LANGUAGE" == "C++11" ] || [ "$COMPILER" == "gcc" ] ; then
# Execute Python unittests
cd Python-Unittests
python -m unittest discover -v
else
echo -e "${WARNING}"
echo "WARNING! Python unittests disabled !!"
echo -e "${NC}"
fi
#!/bin/bash
#Exit on any error
set -e
set -e
LANGUAGE=$1
PATH=$PATH:/opt/local/bin
export PATH
......@@ -12,23 +13,36 @@ OPTIONS=""
if [ "$LANGUAGE" == "C++98" ]; then
echo "Building with C++98";
BUILDPATH="$BUILDPATH-cpp98"
elif [ "$LANGUAGE" == "C++11" ]; then
echo "Building with C++11";
OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' "
fi
BUILDPATH="$BUILDPATH-cpp11"
fi
#=====================================
# Color Settings:
#=====================================
NC='\033[0m'
OUTPUT='\033[0;32m'
WARNING='\033[0;93m'
#########################################
# Build release version
#########################################
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Release version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
if [ ! -d build-release ]; then
mkdir build-release
if [ ! -d build-release-$BUILDPATH-Vector-Checks ]; then
mkdir build-release-$BUILDPATH-Vector-Checks
fi
cd build-release
cd build-release-$BUILDPATH-Vector-Checks
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../
cmake -DCMAKE_BUILD_TYPE=Release -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../
#build it
make
......@@ -36,38 +50,84 @@ make
#build the unit tests
make unittests
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Release version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
#########################################
# Run Release Unittests
#########################################
cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
cd ..
# Execute Python unittests
cd Python-Unittests
cd ..
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Release version with vectorchecks disabled for python tests"
echo "======================================================================"
echo -e "${NC}"
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 $OPTIONS ../
#build it
make
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running Python unittests Release version "
echo "======================================================================"
echo -e "${NC}"
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}"
echo "WARNING! Python unittests disabled for clang on Mac with c++98 !!"
echo -e "${NC}"
fi
rm -f openmesh.so
cp ../Build/python/openmesh.so .
#python -m unittest discover -v
cd ..
cd ..
#########################################
# Build Debug version and Unittests
#########################################
if [ ! -d build-debug ]; then
mkdir build-debug
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Debug version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
if [ ! -d build-debug-$BUILDPATH-Vector-Checks ]; then
mkdir build-debug-$BUILDPATH-Vector-Checks
fi
cd build-debug
cd build-debug-$BUILDPATH-Vector-Checks
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON $OPTIONS ../
cmake -DCMAKE_BUILD_TYPE=Debug -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=OFF $OPTIONS ../
#build it
make
......@@ -75,21 +135,59 @@ make
#build the unit tests
make unittests
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Debug version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
#########################################
# Run Debug Unittests
#########################################
cd Unittests
# Run the unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
cd ..
cd ..
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Building Debug version with vectorchecks disabled for python tests"
echo "======================================================================"
echo -e "${NC}"
if [ ! -d build-debug-$BUILDPATH ]; then
mkdir build-debug-$BUILDPATH
fi
cd build-debug-$BUILDPATH
# Execute Python unittests
cd Python-Unittests
cmake -DCMAKE_BUILD_TYPE=DEBUG -DOPENMESH_BUILD_PYTHON_UNIT_TESTS=ON -DBUILD_APPS=OFF $OPTIONS ../
rm -f openmesh.so
cp ../Build/python/openmesh.so .
#python -m unittest discover -v
#build it
make
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running Python unittests Debug version "
echo "======================================================================"
echo -e "${NC}"
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
else
echo -e "${WARNING}"
echo "WARNING! Python unittests disabled for clang on Mac with c++98 !!"
echo -e "${NC}"
fi
......@@ -134,15 +134,19 @@ if (UNIX)
set ( STL_VECTOR_CHECKS false CACHE BOOL "Include full stl vector checks in debug mode (This option is only used in debug Mode!)" )
endif ( NOT STL_VECTOR_CHECKS )
# Add a flag to check stl vectors in debugging mode
# Add a flag to check stl vectors
if ( STL_VECTOR_CHECKS AND NOT CMAKE_SYSTEM MATCHES "SunOS*" )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment