Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asapo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joao Alvim Oliveira Dias De Almeida
asapo
Commits
8b041d8a
Commit
8b041d8a
authored
9 months ago
by
Marc-Olivier Andrez
Browse files
Options
Downloads
Patches
Plain Diff
build: add coverage flags only when `ENABLE_COVERAGE` is `ON`
parent
6cc7eb6f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeModules/testing_cpp.cmake
+7
-5
7 additions, 5 deletions
CMakeModules/testing_cpp.cmake
with
7 additions
and
5 deletions
CMakeModules/testing_cpp.cmake
+
7
−
5
View file @
8b041d8a
...
...
@@ -25,10 +25,12 @@ if (BUILD_TESTS)
find_program
(
MEMORYCHECK_COMMAND valgrind
)
set
(
MEMORYCHECK_COMMAND_OPTIONS
"--trace-children=yes --leak-check=full --error-exitcode=1 --num-callers=20 --suppressions=
${
CMAKE_SOURCE_DIR
}
/tests/valgrind.suppressions"
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
include
(
CodeCoverage
)
APPEND_COVERAGE_COMPILER_FLAGS
()
endif
()
if
(
ENABLE_COVERAGE
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
include
(
CodeCoverage
)
APPEND_COVERAGE_COMPILER_FLAGS
()
endif
()
endif
()
endif
()
#TODO: Call add_plain_unit_test in gtest
...
...
@@ -91,7 +93,7 @@ function(gtest target test_source_files linktarget)
if
(
ARGN
)
LIST
(
GET ARGN 0 NOCOV
)
endif
()
if
(
CMAKE_COMPILER_IS_GNUCXX AND NOT 1
${
NOCOV
}
STREQUAL
"1nocov"
)
if
(
ENABLE_COVERAGE AND
CMAKE_COMPILER_IS_GNUCXX AND NOT 1
${
NOCOV
}
STREQUAL
"1nocov"
)
set
(
COVERAGE_EXCLUDES
"*/unittests/*"
"*/3d_party/*"
"*/python/*"
"*/service_request*"
)
if
(
ARGN
)
set
(
COVERAGE_EXCLUDES
${
COVERAGE_EXCLUDES
}
${
ARGN
}
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment