diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06f1d62e74aaa9f07a23a91040fb572242713948..2da357dc015d8f927476603fa55ad5935987ae2d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,11 @@ image: rikorose/gcc-cmake before_script: - - apt-get update -qq && apt-get install -y -qq cppcheck vera++ clang-tidy + - apt-get update -qq && apt-get install -y -qq cppcheck vera++ clang-tidy-4.0 - g++ --version - cppcheck --version - vera++ --version + - clang-tidy-4.0 --version - cp ci/vera.profile /usr/lib/vera++/profiles/custom build: diff --git a/CMakeLists.txt b/CMakeLists.txt index 927198fbcc6fe13684f1d930a7095e35e01751cd..60c3d8e969bb35fdf549059aa57d2ed426e230d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.7) project(ecss_services) # Set C++ version to c++17 @@ -7,5 +7,11 @@ set(CMAKE_CXX_STANDARD 17) # Specify the directories for #includes include_directories("${PROJECT_SOURCE_DIR}/inc") +add_custom_target(check + COMMAND ./cppcheck.sh + COMMAND ./vera.sh + COMMAND ./clang-tidy.sh + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/ci") + # Specify the .cpp files for the executables add_executable(ecss_services src/main.cpp src/Message.cpp src/Service.cpp src/Services/TestService.cpp) diff --git a/ci/.clang-tidy b/ci/.clang-tidy index 79398f2d9e97c18310bc0a21370bb701518bae60..f7f41f2c47d298f3f747b2ac1d0a1b2c5cf09be5 100644 --- a/ci/.clang-tidy +++ b/ci/.clang-tidy @@ -17,7 +17,7 @@ Checks: > -misc-non-private-member-variables-in-classes, performance-*, readability-*, -WarningsAsErrors: '*,-misc-unused-parameters,-llvm-header-guard,-cppcoreguidelines-pro-type-member-init, -google-runtime-references' +WarningsAsErrors: '*,-misc-unused-parameters,-llvm-header-guard,-cppcoreguidelines-pro-type-member-init,-google-runtime-references' HeaderFilterRegex: '.*' AnalyzeTemporaryDtors: false ... diff --git a/ci/clang-tidy.sh b/ci/clang-tidy.sh index 051a2a9b79eda985cdb5c6ad10c3b6a7bfd99fb5..8a0c19301fe7e7efc7ff350cd9119e5c4b9c97a5 100755 --- a/ci/clang-tidy.sh +++ b/ci/clang-tidy.sh @@ -7,5 +7,8 @@ # $ ci/clang-tidy.sh # +echo -e "\033[0;34mRunning clang-tidy...\033[0m" + cd "$(dirname "$0")" -clang-tidy `find ../src/ -type f -regextype posix-egrep -regex '.*\.(cpp|hpp|c|h)'` -- -std=c++11 -I../inc +clang-tidy-4.0 `find ../src/ -type f -regextype posix-egrep -regex '.*\.(cpp|hpp|c|h)'` \ + -- -std=c++14 -I../inc diff --git a/ci/cppcheck.sh b/ci/cppcheck.sh index d441040a1b38aceff3fe6232d85ec802fd584c58..a8335c61296643714ec50b402b322253be41c254 100755 --- a/ci/cppcheck.sh +++ b/ci/cppcheck.sh @@ -7,5 +7,7 @@ # $ ci/cppcheck.sh # +echo -e "\033[0;34mRunning cppcheck...\033[0m" + cd "$(dirname "$0")/.." cppcheck --enable=all --error-exitcode=1 -I inc src diff --git a/ci/vera.sh b/ci/vera.sh index 0e2451bfad5fb352a4d085827f52f8892f78d9c3..9f7d0b6a391c7554bc73fe6b1baab1278e49e868 100755 --- a/ci/vera.sh +++ b/ci/vera.sh @@ -7,5 +7,7 @@ # $ ci/vera.sh # +echo -e "\033[0;34mRunning vera++...\033[0m" + cd "$(dirname "$0")/.." vera++ --error --profile custom `find src inc -type f -regextype posix-egrep -regex '.*\.(cpp|hpp|c|h)'`