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
eb353500
Commit
eb353500
authored
Jun 5, 2020
by
Stéphane Del Pino
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into feature/language
parents
24e89d4a
55da1f84
No related branches found
No related tags found
1 merge request
!37
Feature/language
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+54
-28
54 additions, 28 deletions
CMakeLists.txt
with
54 additions
and
28 deletions
CMakeLists.txt
+
54
−
28
View file @
eb353500
...
@@ -289,7 +289,7 @@ add_subdirectory(tests)
...
@@ -289,7 +289,7 @@ add_subdirectory(tests)
enable_testing
()
enable_testing
()
add_custom_target
(
run_unit_tests
add_custom_target
(
run_unit_tests
COMMAND
${
CMAKE_CTEST_COMMAND
}
-j
${
PROCESSOR_COUNT
}
COMMAND
${
CMAKE_CTEST_COMMAND
}
DEPENDS unit_tests mpi_unit_tests
DEPENDS unit_tests mpi_unit_tests
COMMENT
"Executing unit tests."
COMMENT
"Executing unit tests."
)
)
...
@@ -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
}
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
...
@@ -343,7 +368,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
...
@@ -343,7 +368,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
# This way the percentage of total lines covered will always be correct, even when not all source code files were loaded during the test(s)
# This way the percentage of total lines covered will always be correct, even when not all source code files were loaded during the test(s)
COMMAND
${
LCOV
}
-q --gcov
"
${
GCOV_BIN
}
"
--base-directory
"
${
PUGS_BINARY_DIR
}
/src"
--directory
"
${
PUGS_BINARY_DIR
}
"
--capture --initial --output-file coverage_base.info
COMMAND
${
LCOV
}
-q --gcov
"
${
GCOV_BIN
}
"
--base-directory
"
${
PUGS_BINARY_DIR
}
/src"
--directory
"
${
PUGS_BINARY_DIR
}
"
--capture --initial --output-file coverage_base.info
# Run tests
# Run tests
COMMAND
${
CMAKE_CTEST_COMMAND
}
-j
${
PROCESSOR_COUNT
}
COMMAND
${
CMAKE_CTEST_COMMAND
}
# Collect data from executions
# Collect data from executions
COMMAND
${
LCOV
}
--gcov
"
${
GCOV_BIN
}
"
--base-directory
"
${
PUGS_BINARY_DIR
}
/src"
--directory
"
${
PUGS_BINARY_DIR
}
"
--capture --output-file coverage_ctest.info
COMMAND
${
LCOV
}
--gcov
"
${
GCOV_BIN
}
"
--base-directory
"
${
PUGS_BINARY_DIR
}
/src"
--directory
"
${
PUGS_BINARY_DIR
}
"
--capture --output-file coverage_ctest.info
# Combine base and ctest results
# Combine base and ctest results
...
@@ -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,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
...
@@ -362,6 +387,7 @@ 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