From ffaa3a5ff016d043e1060d8228f18bceabf49644 Mon Sep 17 00:00:00 2001 From: ryzhak Date: Tue, 1 Jul 2025 10:49:01 +0300 Subject: [PATCH] build: add test-coverage script --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 0fa6df9bd581d..3e9b3ecc30087 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,15 @@ docker-build-prepare: ## Prepare the Docker build environment. ##@ Test +## Run unit/doc tests and generate html coverage report in `target/llvm-cov/html` folder. +## Notice that `llvm-cov` supports doc tests only in nightly builds because the `--doc` flag +## is unstable (https://github.com/taiki-e/cargo-llvm-cov/issues/2). +.PHONY: test-coverage +test-coverage: + cargo +nightly llvm-cov --no-report nextest -E 'kind(test) & !test(/\b(issue|ext_integration)/)' && \ + cargo +nightly llvm-cov --no-report --doc && \ + cargo +nightly llvm-cov report --doctests --open + .PHONY: test-unit test-unit: ## Run unit tests. cargo nextest run -E 'kind(test) & !test(/\b(issue|ext_integration)/)'