🎉 Added test coverage to sonarscan

This commit is contained in:
2022-05-12 13:50:09 +02:00
parent f508e54ab0
commit 0dc0920b22
6 changed files with 153 additions and 7 deletions

View File

@ -3,11 +3,14 @@ find_package(Catch2 REQUIRED)
include(CTest)
include(Catch)
include(codecov)
add_executable(${PROJECT_NAME} main.cpp test.cpp link_test.cpp)
target_include_directories(moFileReaderTest PRIVATE ${CMAKE_SOURCE_DIR}/include)
target_link_libraries(${PROJECT_NAME} PRIVATE Catch2::Catch2)
catch_discover_tests(${PROJECT_NAME})
catch_discover_tests(${PROJECT_NAME} REPORTER sonarqube OUTPUT_DIR reports)
add_coverage(${PROJECT_NAME})
coverage_evaluate()
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD

View File

@ -1,2 +1,3 @@
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "catch.hpp"
#include "catch_reporter_sonarqube.hpp"