From 7df4b998b6b6777855cef06807f00e25ad66646d Mon Sep 17 00:00:00 2001 From: The-EDev Date: Wed, 14 Apr 2021 14:03:27 +0300 Subject: [PATCH] coverage fix for mustache + coveralls job id specification from drone --- .drone.yml | 2 ++ tests/template/CMakeLists.txt | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/.drone.yml b/.drone.yml index bbf1597d1..a649d5057 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,6 +16,7 @@ steps: commands: - export DEBIAN_FRONTEND=noninteractive - export TRAVIS_BRANCH=$DRONE_SOURCE_BRANCH + - export TRAVIS_JOB_ID=$DRONE_BUILD_NUMBER - apt-get -y update - apt-get -y install libboost-all-dev doxygen mkdocs graphviz zlib1g-dev gcc clang make cmake python3 python3-pip git - pip3 install mkdocs-material cpp-coveralls pyyaml @@ -105,6 +106,7 @@ steps: - export DEBIAN_FRONTEND=noninteractive - export DOXYFILE=$DRONE_BUILD_DIR/Doxyfile - export TRAVIS_BRANCH=$DRONE_REPO_BRANCH + - export TRAVIS_JOB_ID=$DRONE_BUILD_NUMBER - apt-get -y update - apt-get -y install libboost-all-dev doxygen mkdocs graphviz zlib1g-dev gcc clang make cmake python3 python3-pip git - pip3 install mkdocs-material cpp-coveralls pyyaml diff --git a/tests/template/CMakeLists.txt b/tests/template/CMakeLists.txt index 9b8c1fb89..31e2ac266 100644 --- a/tests/template/CMakeLists.txt +++ b/tests/template/CMakeLists.txt @@ -11,6 +11,12 @@ set(TEST_SRCS add_executable(mustachetest ${TEST_SRCS}) target_compile_options(mustachetest PRIVATE "${compiler_options}") + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set_target_properties(mustachetest PROPERTIES COMPILE_FLAGS "--coverage -fprofile-arcs -ftest-coverage") + target_link_libraries(mustachetest gcov) +endif() + file(COPY DIRECTORY . DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILES_MATCHING PATTERN "*.json") add_custom_command(OUTPUT test.py