Skip to content
Snippets Groups Projects
Verified Commit cee90bed authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: fix coverage

parent 9d72b950
No related branches found
No related tags found
No related merge requests found
Pipeline #9844 passed
Pipeline: caosdb-cppinttest

#9845

    ...@@ -55,7 +55,7 @@ add_executable(caosdbcli src/caosdbcli.cpp) ...@@ -55,7 +55,7 @@ add_executable(caosdbcli src/caosdbcli.cpp)
    # linting is active when BUILD_TYPE == "Debug" # linting is active when BUILD_TYPE == "Debug"
    if("${CMAKE_BUILD_TYPE}" MATCHES "Debug") if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
    #set(_LINTING ON) set(_LINTING ON)
    endif() endif()
    if(_LINTING) if(_LINTING)
    find_program(iwyu find_program(iwyu
    ......
    ...@@ -82,6 +82,11 @@ ...@@ -82,6 +82,11 @@
    # 2021-05-20, Timm Fitschen <t.fitschen@indiscale.com> # 2021-05-20, Timm Fitschen <t.fitschen@indiscale.com>
    # - Fix: this script should also accept GCC as a (plain) C compiler. # - Fix: this script should also accept GCC as a (plain) C compiler.
    # #
    # 2021-07-05, Timm Fitschen <t.fitschen@indiscale.com>
    # - Removed -fprofile-abs-path again, because it would not work when using
    # gcc as compiler, but clang-tidy as linter. Probably there is a better fix.
    # clang error: `error: unknown argument: '-fprofile-abs-path' [clang-diagnostic-error]`
    #
    # USAGE: # USAGE:
    # #
    # 1. Copy this file into your cmake modules path. # 1. Copy this file into your cmake modules path.
    ...@@ -165,13 +170,13 @@ endif() ...@@ -165,13 +170,13 @@ endif()
    set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage" set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
    CACHE INTERNAL "") CACHE INTERNAL "")
    if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") #if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
    include(CheckCXXCompilerFlag) #include(CheckCXXCompilerFlag)
    check_cxx_compiler_flag(-fprofile-abs-path HAVE_fprofile_abs_path) #check_cxx_compiler_flag(-fprofile-abs-path HAVE_fprofile_abs_path)
    if(HAVE_fprofile_abs_path) #if(HAVE_fprofile_abs_path)
    set(COVERAGE_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path") #set(COVERAGE_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
    endif() #endif()
    endif() #endif()
    set(CMAKE_Fortran_FLAGS_COVERAGE set(CMAKE_Fortran_FLAGS_COVERAGE
    ${COVERAGE_COMPILER_FLAGS} ${COVERAGE_COMPILER_FLAGS}
    ......
    ...@@ -115,7 +115,6 @@ SslCaosDBConnectionConfig::SslCaosDBConnectionConfig( ...@@ -115,7 +115,6 @@ SslCaosDBConnectionConfig::SslCaosDBConnectionConfig(
    : CaosDBConnectionConfig(host, port) { : CaosDBConnectionConfig(host, port) {
    SslCredentialsOptions options; SslCredentialsOptions options;
    options.pem_root_certs = cacert->getCACertPem(); options.pem_root_certs = cacert->getCACertPem();
    std::cout << "HERE" << options.pem_root_certs;
    this->credentials = SslCredentials(options); this->credentials = SslCredentials(options);
    } }
    ...@@ -159,7 +158,7 @@ auto operator<<(std::ostream &out, const CaosDBConnection &connection) ...@@ -159,7 +158,7 @@ auto operator<<(std::ostream &out, const CaosDBConnection &connection)
    [[nodiscard]] auto CaosDBConnection::getVersionInfo() const [[nodiscard]] auto CaosDBConnection::getVersionInfo() const
    -> std::unique_ptr<VersionInfo> { -> std::unique_ptr<VersionInfo> {
    GetVersionInfoRequest request; const GetVersionInfoRequest request;
    GetVersionInfoResponse response; GetVersionInfoResponse response;
    grpc::ClientContext context; grpc::ClientContext context;
    const grpc::Status status = const grpc::Status status =
    ......
    ...@@ -77,6 +77,7 @@ if (LCOV_PATH) ...@@ -77,6 +77,7 @@ if (LCOV_PATH)
    LCOV_ARGS --rc lcov_branch_coverage=1 --no-external LCOV_ARGS --rc lcov_branch_coverage=1 --no-external
    GENHTML_ARGS --rc lcov_branch_coverage=1 GENHTML_ARGS --rc lcov_branch_coverage=1
    ) )
    message(STATUS "Adding COMPILE_FLAGS for coverage: ${COVERAGE_COMPILER_FLAGS}")
    set_target_properties(caosdb PROPERTIES set_target_properties(caosdb PROPERTIES
    COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}") COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}")
    else () else ()
    ......
    ...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
    #include "gtest/gtest_pred_impl.h" // for Test, AssertionResult, EXPECT_EQ #include "gtest/gtest_pred_impl.h" // for Test, AssertionResult, EXPECT_EQ
    namespace grpc { namespace grpc {
    class ChannelCredentials; class ChannelCredentials;
    } } // namespace grpc
    namespace caosdb::connection { namespace caosdb::connection {
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment