Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage #494

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ configure_file(

# setting up compilations options

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
set(CMAKE_COMPILER_IS_CLANG ON)
endif ()

Expand Down Expand Up @@ -182,11 +182,11 @@ if (ARK_TESTS)
target_compile_features(unittests PRIVATE cxx_std_20)
target_compile_definitions(unittests PRIVATE ARK_TESTS_ROOT="${CMAKE_CURRENT_SOURCE_DIR}/")

if (ARK_COVERAGE AND NOT WIN32)
target_compile_options(unittests PRIVATE -coverage)
target_link_options(unittests PRIVATE -coverage)
target_compile_options(ArkReactor PRIVATE -coverage)
target_link_options(ArkReactor PRIVATE -coverage)
if (ARK_COVERAGE AND CMAKE_COMPILER_IS_CLANG)
target_compile_options(unittests PRIVATE -coverage -fcoverage-mapping -fprofile-instr-generate)
target_link_options(unittests PRIVATE -coverage -fcoverage-mapping -fprofile-instr-generate)
target_compile_options(ArkReactor PRIVATE -coverage -fcoverage-mapping -fprofile-instr-generate)
target_link_options(ArkReactor PRIVATE -coverage -fcoverage-mapping -fprofile-instr-generate)

# find required tools
find_program(LCOV lcov REQUIRED)
Expand All @@ -196,7 +196,6 @@ if (ARK_TESTS)
add_custom_target(coverage
# gather data
COMMAND ${LCOV} --directory . --capture
--rc lcov_branch_coverage=1
--rc derive_function_end_line=0
--ignore-errors inconsistent
--filter range
Expand All @@ -208,7 +207,6 @@ if (ARK_TESTS)
# generate report
COMMAND ${GENHTML}
--demangle-cpp
--rc lcov_branch_coverage=1
--rc derive_function_end_line=0
-o coverage coverage.info
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![Code size](https://img.shields.io/github/languages/code-size/arkscript-lang/ark?style=for-the-badge&logo=github)
![Downloads](https://img.shields.io/github/downloads/arkscript-lang/ark/total?color=%2324cc24&style=for-the-badge&logo=github)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ArkScript-lang/Ark/ci.yml?logo=cmake&style=for-the-badge&branch=dev)
[![Coverage Status](https://coveralls.io/repos/github/ArkScript-lang/Ark/badge.svg?branch=dev)](https://coveralls.io/github/ArkScript-lang/Ark?branch=dev)
[![Coverage](https://img.shields.io/coverallsCoverage/github/ArkScript-lang/Ark?branch=dev&style=for-the-badge)](https://coveralls.io/github/ArkScript-lang/Ark?branch=dev)

<img align="right" src=".github/images/ArkTransparent-by-mazz.png" width=200px alt="ArkScript log by Mazz">

Expand Down