mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-17 16:35:57 +00:00
Add viewcoverage and fix coverage generation
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -40,3 +40,4 @@ build_release
|
|||||||
cmake-*
|
cmake-*
|
||||||
**/CMakeFiles
|
**/CMakeFiles
|
||||||
**/gcovr-report
|
**/gcovr-report
|
||||||
|
CMakeUserPresets.json
|
||||||
|
19
Makefile
19
Makefile
@@ -1,10 +1,12 @@
|
|||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
.DEFAULT_GOAL := release
|
.DEFAULT_GOAL := release
|
||||||
.PHONY: debug release install test conan-create
|
.PHONY: debug release install test conan-create viewcoverage
|
||||||
lcov := lcov
|
lcov := lcov
|
||||||
|
|
||||||
f_debug = build_debug
|
f_debug = build_debug
|
||||||
f_release = build_release
|
f_release = build_release
|
||||||
|
genhtml = genhtml
|
||||||
|
docscdir = docs
|
||||||
|
|
||||||
define build_target
|
define build_target
|
||||||
@echo ">>> Building the project for $(1)..."
|
@echo ">>> Building the project for $(1)..."
|
||||||
@@ -38,7 +40,8 @@ test: ## Build Debug version and run tests
|
|||||||
$(lcov) --remove coverage.info 'lib/*' --output-file coverage.info >/dev/null 2>&1; \
|
$(lcov) --remove coverage.info 'lib/*' --output-file coverage.info >/dev/null 2>&1; \
|
||||||
$(lcov) --remove coverage.info 'libtorch/*' --output-file coverage.info >/dev/null 2>&1; \
|
$(lcov) --remove coverage.info 'libtorch/*' --output-file coverage.info >/dev/null 2>&1; \
|
||||||
$(lcov) --remove coverage.info 'tests/*' --output-file coverage.info >/dev/null 2>&1; \
|
$(lcov) --remove coverage.info 'tests/*' --output-file coverage.info >/dev/null 2>&1; \
|
||||||
$(lcov) --remove coverage.info 'gtest/*' --output-file coverage.info >/dev/null 2>&1;
|
$(lcov) --remove coverage.info 'gtest/*' --output-file coverage.info >/dev/null 2>&1; \
|
||||||
|
$(lcov) --remove coverage.info '*/.conan2/*' --ignore-errors unused --output-file coverage.info >/dev/null 2>&1;
|
||||||
@genhtml $(f_debug)/tests/coverage.info --demangle-cpp --output-directory $(f_debug)/tests/coverage --title "Discretizer mdlp Coverage Report" -s -k -f --legend
|
@genhtml $(f_debug)/tests/coverage.info --demangle-cpp --output-directory $(f_debug)/tests/coverage --title "Discretizer mdlp Coverage Report" -s -k -f --legend
|
||||||
@echo "* Coverage report is generated at $(f_debug)/tests/coverage/index.html"
|
@echo "* Coverage report is generated at $(f_debug)/tests/coverage/index.html"
|
||||||
@which python || (echo ">>> Please install python"; exit 1)
|
@which python || (echo ">>> Please install python"; exit 1)
|
||||||
@@ -48,6 +51,18 @@ test: ## Build Debug version and run tests
|
|||||||
fi
|
fi
|
||||||
@echo ">>> Updating coverage badge..."
|
@echo ">>> Updating coverage badge..."
|
||||||
@env python update_coverage.py $(f_debug)/tests
|
@env python update_coverage.py $(f_debug)/tests
|
||||||
|
@echo ">>> Done"
|
||||||
|
|
||||||
|
viewcoverage: ## View the html coverage report
|
||||||
|
@which $(genhtml) >/dev/null || (echo ">>> Please install lcov (genhtml not found)"; exit 1)
|
||||||
|
@if [ ! -d $(docscdir)/coverage ]; then mkdir -p $(docscdir)/coverage; fi
|
||||||
|
@if [ ! -f $(f_debug)/tests/coverage.info ]; then \
|
||||||
|
echo ">>> No coverage.info file found. Run make coverage first!"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
@$(genhtml) $(f_debug)/tests/coverage.info --demangle-cpp --output-directory $(docscdir)/coverage --title "FImdlp Coverage Report" -s -k -f --legend >/dev/null 2>&1;
|
||||||
|
@xdg-open $(docscdir)/coverage/index.html || open $(docscdir)/coverage/index.html 2>/dev/null
|
||||||
|
@echo ">>> Done";
|
||||||
|
|
||||||
conan-create: ## Create the conan package
|
conan-create: ## Create the conan package
|
||||||
@echo ">>> Creating the conan package..."
|
@echo ">>> Creating the conan package..."
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
[](https://github.com/rmontanana/mdlp/actions/workflows/build.yml)
|
[](https://github.com/rmontanana/mdlp/actions/workflows/build.yml)
|
||||||
[](https://sonarcloud.io/summary/new_code?id=rmontanana_mdlp)
|
[](https://sonarcloud.io/summary/new_code?id=rmontanana_mdlp)
|
||||||
[](https://sonarcloud.io/summary/new_code?id=rmontanana_mdlp)
|
[](https://sonarcloud.io/summary/new_code?id=rmontanana_mdlp)
|
||||||
[](html/index.html)
|
[](html/index.html)
|
||||||
[](https://deepwiki.com/rmontanana/mdlp)
|
[](https://deepwiki.com/rmontanana/mdlp)
|
||||||
[](https://doi.org/10.5281/zenodo.14245443)
|
[](https://doi.org/10.5281/zenodo.14245443)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user