Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
55da1f84
Commit
55da1f84
authored
Jun 5, 2020
by
Stéphane Del Pino
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/fastcov' into 'develop'
Add support for fastcov See merge request
!36
parents
75e383ff
ba905fe7
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!36
Add support for fastcov
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+54
-27
54 additions, 27 deletions
CMakeLists.txt
with
54 additions
and
27 deletions
CMakeLists.txt
+
54
−
27
View file @
55da1f84
...
@@ -335,6 +335,31 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
...
@@ -335,6 +335,31 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
message
(
FATAL_ERROR
"Cannot find a proper gcov tool, cannot perform coverage."
)
message
(
FATAL_ERROR
"Cannot find a proper gcov tool, cannot perform coverage."
)
endif
()
endif
()
find_program
(
FASTCOV fastcov fastcov.py
)
if
(
FASTCOV
AND
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
AND
(
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER
"9"
))
add_custom_target
(
coverage
ALL
# in coverage mode we do coverage!
# Run tests
COMMAND
${
CMAKE_CTEST_COMMAND
}
-j
${
PROCESSOR_COUNT
}
COMMAND
${
FASTCOV
}
-q --gcov
"
${
GCOV_BIN
}
"
--include
"
${
PUGS_SOURCE_DIR
}
/src"
--exclude
"
${
PUGS_SOURCE_DIR
}
/src/main.cpp"
--exclude
"
${
PUGS_SOURCE_DIR
}
/src/utils/BacktraceManager.*"
--lcov -o coverage.info -n
COMMAND
${
LCOV
}
--gcov
"
${
GCOV_BIN
}
"
--list coverage.info
DEPENDS unit_tests mpi_unit_tests
COMMENT
"Running test coverage."
WORKING_DIRECTORY
"
${
PUGS_BINARY_DIR
}
"
)
else
()
add_custom_target
(
coverage
add_custom_target
(
coverage
ALL
# in coverage mode we do coverage!
ALL
# in coverage mode we do coverage!
# Cleanup previously generated profiling data
# Cleanup previously generated profiling data
...
@@ -354,7 +379,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
...
@@ -354,7 +379,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
# Remove unwanted stuff
# Remove unwanted stuff
COMMAND
${
LCOV
}
--gcov
"
${
GCOV_BIN
}
"
--remove coverage_extract.info --output-file coverage.info
COMMAND
${
LCOV
}
--gcov
"
${
GCOV_BIN
}
"
--remove coverage_extract.info --output-file coverage.info
'
${
PUGS_SOURCE_DIR
}
/src/main.cpp'
'
${
PUGS_SOURCE_DIR
}
/src/main.cpp'
'
${
PUGS_SOURCE_DIR
}
/utils/BacktraceManager.*'
'
${
PUGS_SOURCE_DIR
}
/
src/
utils/BacktraceManager.*'
COMMAND
${
LCOV
}
--gcov
"
${
GCOV_BIN
}
"
--list coverage.info
COMMAND
${
LCOV
}
--gcov
"
${
GCOV_BIN
}
"
--list coverage.info
...
@@ -362,6 +387,8 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
...
@@ -362,6 +387,8 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
COMMENT
"Running test coverage."
COMMENT
"Running test coverage."
WORKING_DIRECTORY
"
${
PUGS_BINARY_DIR
}
"
WORKING_DIRECTORY
"
${
PUGS_BINARY_DIR
}
"
)
)
endif
()
find_program
(
GENHTML genhtml
)
find_program
(
GENHTML genhtml
)
if
(
NOT GENHTML
)
if
(
NOT GENHTML
)
...
...
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