diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c7117fc7..74a6b10d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -140,6 +140,11 @@ test_ubuntu: <<: *ubuntu <<: *test_linux +# cpp guideline checks +test_guidelines: + stage: test + script: + - docker run netgen_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id -e CCACHE_DIR=/ccache -v /mnt/ccache:/ccache netgen_${CI_BUILD_REF_NAME}:${UBUNTU_VERSION} bash /root/src/netgen/tests/build_guidelines.sh ############################################ # Deploy stage ############################################ diff --git a/libsrc/core/archive.cpp b/libsrc/core/archive.cpp index 56bc5426..2e6c32ae 100644 --- a/libsrc/core/archive.cpp +++ b/libsrc/core/archive.cpp @@ -24,7 +24,7 @@ namespace ngcore void SetLibraryVersion(const std::string& library, const VersionInfo& version) { library_versions[library] = version; } -#ifdef WIN +#ifdef WIN32 // windows does demangling in typeid(T).name() std::string Demangle(const char* typeinfo) { return typeinfo; } #else diff --git a/tests/build.sh b/tests/build.sh index d2727b2c..68aea3ad 100755 --- a/tests/build.sh +++ b/tests/build.sh @@ -1,6 +1,6 @@ cd mkdir -p build/netgen cd build/netgen -cmake ../../src/netgen -DUSE_CCACHE=ON -DENABLE_CPP_CORE_GUIDELINES_CHECK=ON +cmake ../../src/netgen -DUSE_CCACHE=ON make -j12 make install diff --git a/tests/build_guidelines.sh b/tests/build_guidelines.sh new file mode 100644 index 00000000..111b1cd0 --- /dev/null +++ b/tests/build_guidelines.sh @@ -0,0 +1,8 @@ +cd +mkdir -p build/netgen +cd build/netgen +cmake ../../src/netgen -DUSE_CCACHE=ON -DENABLE_CPP_CORE_GUIDELINES_CHECK=ON -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_C_COMPILER=clang +make -j12 +make install + diff --git a/tests/dockerfile b/tests/dockerfile index 4567fdc4..ebed3dea 100644 --- a/tests/dockerfile +++ b/tests/dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive MAINTAINER Matthias Hochsteger -RUN apt-get update && apt-get -y install python3 libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev ccache python3-pytest python3-numpy python3-tk clang-tidy python3-distutils +RUN apt-get update && apt-get -y install python3 libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev ccache python3-pytest python3-numpy python3-tk clang-tidy python3-distutils clang ADD . /root/src/netgen