diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67e46abf..3e6b9399 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -847,7 +847,7 @@ macos-cpp14-release: macos-M1-cpp14-debug: stage: build - script: "CI/ci-mac-build.sh cpp14 debug ; CI/ci-mac-test.sh cpp14 debug" + script: "CI/ci-mac-M1-build.sh cpp14 debug ; CI/ci-mac-M1-test.sh cpp14 debug" tags: - AppleM1 artifacts: @@ -867,7 +867,7 @@ macos-M1-cpp14-debug: macos-M1-cpp14-release: stage: build - script: "CI/ci-mac-build.sh cpp14 release ; CI/ci-mac-test.sh cpp14 release" + script: "CI/ci-mac-M1-build.sh cpp14 release ; CI/ci-mac-M1-test.sh cpp14 release" tags: - AppleM1 artifacts: diff --git a/CI/ci-mac-M1-build.sh b/CI/ci-mac-M1-build.sh new file mode 100755 index 00000000..d8e9ed48 --- /dev/null +++ b/CI/ci-mac-M1-build.sh @@ -0,0 +1,63 @@ +#!/bin/bash +source CI/ci-mac-M1-prepare.sh + +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" + +cmake --version + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building $BUILD_TYPE version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" + + +if [ ! -d build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks ]; then + mkdir build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks +fi + +cd build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks + +cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../ + +#build it +make + +cd .. + +if [ "$BUILD_TYPE_L" == "release" ]; then + + echo -e "${OUTPUT}" + echo "" + echo "======================================================================" + echo "Package creation (DMG and tarball)" + echo "======================================================================" + echo -e "${NC}" + + + if [ ! -d build-release-$BUILDPATH ]; then + mkdir build-release-$BUILDPATH + fi + + cd build-release-$BUILDPATH + + cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_APPS=OFF -DCPACK_BINARY_DRAGNDROP=ON $OPTIONS ../ + + #build it + make + make package + + cd .. + +fi diff --git a/CI/ci-mac-M1-prepare.sh b/CI/ci-mac-M1-prepare.sh new file mode 100755 index 00000000..ce5505a7 --- /dev/null +++ b/CI/ci-mac-M1-prepare.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#Exit on any error +set -e + +LANGUAGE=$1 +BUILD_TYPE=$2 + +PATH=$PATH:/opt/local/bin +export PATH + +OPTIONS="" + +# set qt version path +OPTIONS="$OPTIONS -DQT_VERSION=6" + + + +if [ "$LANGUAGE" == "cpp11" ]; then + echo "Building with C++11"; + OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' " + BUILDPATH="cpp11" +elif [ "$LANGUAGE" == "cpp14" ]; then + echo "Building with C++14"; + OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++14' " + BUILDPATH="cpp14" +fi + +#===================================== +# Color Settings: +#===================================== +NC='\033[0m' +OUTPUT='\033[0;32m' +WARNING='\033[0;93m' + +if [ "$BUILD_TYPE" == "release" ]; then + export BUILD_TYPE=Release + export BUILD_TYPE_L=release +else + export BUILD_TYPE=Debug + export BUILD_TYPE_L=debug +fi diff --git a/CI/ci-mac-M1-test.sh b/CI/ci-mac-M1-test.sh new file mode 100755 index 00000000..eee6306d --- /dev/null +++ b/CI/ci-mac-M1-test.sh @@ -0,0 +1,65 @@ +#!/bin/bash +source CI/ci-mac-M1-prepare.sh + +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}" +echo "" +echo "======================================================================" +echo "Building $BUILD_TYPE version unittests" +echo "======================================================================" +echo -e "${NC}" + + +if [ ! -d build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks ]; then + mkdir build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks +fi + +cd build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks + +#build the unit tests +make unittests + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests $BUILD_TYPE version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" + +cd Unittests + +#execute tests +./unittests --gtest_color=yes --gtest_output=xml:./report.xml + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests $BUILD_TYPE version with minimal vector type" +echo "======================================================================" +echo -e "${NC}" + +./unittests_customvec --gtest_color=yes --gtest_output=xml:./report-customvec.xml + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests $BUILD_TYPE version with double vector type" +echo "======================================================================" +echo -e "${NC}" + +#execute tests +./unittests_doublevec --gtest_color=yes --gtest_output=xml:./report-doublevec.xml + +cd .. +cd .. diff --git a/CI/gitlab-ci/mac-m1-template-job.yml b/CI/gitlab-ci/mac-m1-template-job.yml index bc65e997..f1606670 100644 --- a/CI/gitlab-ci/mac-m1-template-job.yml +++ b/CI/gitlab-ci/mac-m1-template-job.yml @@ -5,7 +5,7 @@ macos-M1-{{LANGUAGE}}-{{BUILDTYPE}}: stage: build - script: "CI/ci-mac-build.sh {{LANGUAGE}} {{BUILDTYPE}} ; CI/ci-mac-test.sh {{LANGUAGE}} {{BUILDTYPE}}" + script: "CI/ci-mac-M1-build.sh {{LANGUAGE}} {{BUILDTYPE}} ; CI/ci-mac-M1-test.sh {{LANGUAGE}} {{BUILDTYPE}}" tags: - AppleM1 artifacts: