2020-05-02 12:33:52 +02:00
|
|
|
IMAGE_BASE ?= kanidm
|
2020-08-06 08:05:33 +02:00
|
|
|
IMAGE_VERSION ?= devel
|
2023-08-01 09:25:32 +02:00
|
|
|
IMAGE_EXT_VERSION ?= 1.1.0-rc.14-dev
|
2022-05-24 07:25:04 +02:00
|
|
|
CONTAINER_TOOL_ARGS ?=
|
2020-12-30 03:29:01 +01:00
|
|
|
IMAGE_ARCH ?= "linux/amd64,linux/arm64"
|
2022-05-26 13:13:07 +02:00
|
|
|
CONTAINER_BUILD_ARGS ?=
|
2022-12-26 23:52:03 +01:00
|
|
|
MARKDOWN_FORMAT_ARGS ?= --options-line-width=100
|
2022-05-23 08:37:41 +02:00
|
|
|
CONTAINER_TOOL ?= docker
|
2023-02-17 08:02:01 +01:00
|
|
|
BUILDKIT_PROGRESS ?= plain
|
2023-07-05 14:26:39 +02:00
|
|
|
TESTS ?=
|
2022-03-09 23:55:44 +01:00
|
|
|
BOOK_VERSION ?= master
|
2023-08-14 02:06:53 +02:00
|
|
|
GIT_COMMIT := $(shell git rev-parse HEAD)
|
2022-03-09 23:55:44 +01:00
|
|
|
|
2020-05-02 12:33:52 +02:00
|
|
|
.DEFAULT: help
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: help
|
2020-05-02 12:33:52 +02:00
|
|
|
help:
|
2022-12-16 08:23:22 +01:00
|
|
|
@grep -E -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
2020-05-02 12:33:52 +02:00
|
|
|
|
2023-07-05 14:26:39 +02:00
|
|
|
.PHONY: run
|
|
|
|
run: ## Run the test/dev server
|
|
|
|
run:
|
|
|
|
cd server/daemon && ./run_insecure_dev_server.sh
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: buildx/kanidmd
|
2022-06-20 12:16:55 +02:00
|
|
|
buildx/kanidmd: ## Build multiarch kanidm server images and push to docker hub
|
2023-02-17 08:02:01 +01:00
|
|
|
buildx/kanidmd:
|
2023-05-25 05:42:18 +02:00
|
|
|
@echo $(IMAGE_EXT_VERSION)
|
2022-06-20 12:16:55 +02:00
|
|
|
@$(CONTAINER_TOOL) buildx build $(CONTAINER_TOOL_ARGS) \
|
|
|
|
--pull --push --platform $(IMAGE_ARCH) \
|
2023-03-02 03:47:23 +01:00
|
|
|
-f server/Dockerfile \
|
2022-06-20 12:16:55 +02:00
|
|
|
-t $(IMAGE_BASE)/server:$(IMAGE_VERSION) \
|
2023-05-25 05:42:18 +02:00
|
|
|
-t $(IMAGE_BASE)/server:$(IMAGE_EXT_VERSION) \
|
2023-02-17 08:02:01 +01:00
|
|
|
--progress $(BUILDKIT_PROGRESS) \
|
2021-03-26 02:22:00 +01:00
|
|
|
--build-arg "KANIDM_BUILD_PROFILE=container_generic" \
|
|
|
|
--build-arg "KANIDM_FEATURES=" \
|
2023-08-14 02:06:53 +02:00
|
|
|
--label "com.kanidm.git-commit=$(GIT_COMMIT)" \
|
|
|
|
--label "com.kanidm.version=$(IMAGE_EXT_VERSION)" \
|
2022-05-24 07:25:04 +02:00
|
|
|
$(CONTAINER_BUILD_ARGS) .
|
2020-07-24 09:38:59 +02:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: buildx/kanidm_tools
|
2022-11-09 22:42:03 +01:00
|
|
|
buildx/kanidm_tools: ## Build multiarch kanidm tool images and push to docker hub
|
2023-02-17 08:02:01 +01:00
|
|
|
buildx/kanidm_tools:
|
2022-11-09 22:42:03 +01:00
|
|
|
@$(CONTAINER_TOOL) buildx build $(CONTAINER_TOOL_ARGS) \
|
|
|
|
--pull --push --platform $(IMAGE_ARCH) \
|
2023-03-02 03:47:23 +01:00
|
|
|
-f tools/Dockerfile \
|
2022-11-09 22:42:03 +01:00
|
|
|
-t $(IMAGE_BASE)/tools:$(IMAGE_VERSION) \
|
2023-05-25 05:42:18 +02:00
|
|
|
-t $(IMAGE_BASE)/tools:$(IMAGE_EXT_VERSION) \
|
2023-02-17 08:02:01 +01:00
|
|
|
--progress $(BUILDKIT_PROGRESS) \
|
2022-11-09 22:42:03 +01:00
|
|
|
--build-arg "KANIDM_BUILD_PROFILE=container_generic" \
|
|
|
|
--build-arg "KANIDM_FEATURES=" \
|
2023-08-14 02:06:53 +02:00
|
|
|
--label "com.kanidm.git-commit=$(GIT_COMMIT)" \
|
|
|
|
--label "com.kanidm.version=$(IMAGE_EXT_VERSION)" \
|
2022-11-09 22:42:03 +01:00
|
|
|
$(CONTAINER_BUILD_ARGS) .
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: buildx/radiusd
|
2022-06-20 12:16:55 +02:00
|
|
|
buildx/radiusd: ## Build multi-arch radius docker images and push to docker hub
|
2020-08-17 09:16:33 +02:00
|
|
|
buildx/radiusd:
|
2022-06-20 12:16:55 +02:00
|
|
|
@$(CONTAINER_TOOL) buildx build $(CONTAINER_TOOL_ARGS) \
|
|
|
|
--pull --push --platform $(IMAGE_ARCH) \
|
2023-03-02 03:47:23 +01:00
|
|
|
-f rlm_python/Dockerfile \
|
2023-02-17 08:02:01 +01:00
|
|
|
--progress $(BUILDKIT_PROGRESS) \
|
2023-08-14 02:06:53 +02:00
|
|
|
--label "com.kanidm.git-commit=$(GIT_COMMIT)" \
|
|
|
|
--label "com.kanidm.version=$(IMAGE_EXT_VERSION)" \
|
2023-05-25 05:42:18 +02:00
|
|
|
-t $(IMAGE_BASE)/radius:$(IMAGE_VERSION) \
|
|
|
|
-t $(IMAGE_BASE)/radius:$(IMAGE_EXT_VERSION) .
|
2020-08-17 09:16:33 +02:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: buildx
|
2023-03-02 03:47:23 +01:00
|
|
|
buildx: buildx/kanidmd buildx/kanidm_tools buildx/radiusd
|
2020-08-17 09:16:33 +02:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: build/kanidmd
|
2022-06-20 12:16:55 +02:00
|
|
|
build/kanidmd: ## Build the kanidmd docker image locally
|
2020-05-02 12:33:52 +02:00
|
|
|
build/kanidmd:
|
2023-05-25 05:42:18 +02:00
|
|
|
@$(CONTAINER_TOOL) build $(CONTAINER_TOOL_ARGS) -f server/Dockerfile \
|
|
|
|
-t $(IMAGE_BASE)/server:$(IMAGE_VERSION) \
|
2022-06-05 07:30:47 +02:00
|
|
|
--build-arg "KANIDM_BUILD_PROFILE=container_generic" \
|
2021-03-26 02:22:00 +01:00
|
|
|
--build-arg "KANIDM_FEATURES=" \
|
2023-08-14 02:06:53 +02:00
|
|
|
--label "com.kanidm.git-commit=$(GIT_COMMIT)" \
|
|
|
|
--label "com.kanidm.version=$(IMAGE_EXT_VERSION)" \
|
2022-05-24 07:25:04 +02:00
|
|
|
$(CONTAINER_BUILD_ARGS) .
|
2020-05-02 12:33:52 +02:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: build/radiusd
|
2022-06-20 12:16:55 +02:00
|
|
|
build/radiusd: ## Build the radiusd docker image locally
|
2020-05-02 12:33:52 +02:00
|
|
|
build/radiusd:
|
2022-06-20 12:16:55 +02:00
|
|
|
@$(CONTAINER_TOOL) build $(CONTAINER_TOOL_ARGS) \
|
2023-03-02 03:47:23 +01:00
|
|
|
-f rlm_python/Dockerfile \
|
2023-08-14 02:06:53 +02:00
|
|
|
--label "com.kanidm.git-commit=$(GIT_COMMIT)" \
|
|
|
|
--label "com.kanidm.version=$(IMAGE_EXT_VERSION)" \
|
2022-06-20 12:16:55 +02:00
|
|
|
-t $(IMAGE_BASE)/radius:$(IMAGE_VERSION) .
|
2020-05-02 12:33:52 +02:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: build
|
2020-06-30 06:21:59 +02:00
|
|
|
build: build/kanidmd build/radiusd
|
2020-05-02 12:33:52 +02:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: test/kanidmd
|
2022-06-20 12:16:55 +02:00
|
|
|
test/kanidmd: ## Run cargo test in docker
|
2020-06-30 06:21:59 +02:00
|
|
|
test/kanidmd:
|
2022-05-23 08:37:41 +02:00
|
|
|
@$(CONTAINER_TOOL) build \
|
2023-03-02 03:47:23 +01:00
|
|
|
$(CONTAINER_TOOL_ARGS) -f server/Dockerfile \
|
2020-06-30 06:21:59 +02:00
|
|
|
--target builder \
|
|
|
|
-t $(IMAGE_BASE)/server:$(IMAGE_VERSION)-builder \
|
2023-08-14 02:06:53 +02:00
|
|
|
--label "com.kanidm.git-commit=$(GIT_COMMIT)" \
|
|
|
|
--label "com.kanidm.version=$(IMAGE_EXT_VERSION)" \
|
2022-05-24 07:25:04 +02:00
|
|
|
$(CONTAINER_BUILD_ARGS) .
|
2022-05-23 08:37:41 +02:00
|
|
|
@$(CONTAINER_TOOL) run --rm $(IMAGE_BASE)/server:$(IMAGE_VERSION)-builder cargo test
|
2020-06-30 06:21:59 +02:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: test/radiusd
|
2022-06-20 12:16:55 +02:00
|
|
|
test/radiusd: ## Run a test radius server
|
2022-07-22 05:04:36 +02:00
|
|
|
test/radiusd: build/radiusd
|
2023-03-02 03:47:23 +01:00
|
|
|
cd rlm_python && \
|
2022-06-20 12:16:55 +02:00
|
|
|
./run_radius_container.sh
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: test
|
2022-07-20 09:21:40 +02:00
|
|
|
test:
|
|
|
|
cargo test
|
2020-06-30 06:21:59 +02:00
|
|
|
|
2023-01-24 00:38:19 +01:00
|
|
|
.PHONY: precommit
|
|
|
|
precommit: ## all the usual test things
|
|
|
|
precommit: test codespell test/pykanidm doc/format
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: vendor
|
2021-03-26 02:22:00 +01:00
|
|
|
vendor:
|
2023-02-06 00:50:10 +01:00
|
|
|
cargo vendor > cargo_vendor_config
|
2021-03-26 02:22:00 +01:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: vendor-prep
|
2021-03-26 02:22:00 +01:00
|
|
|
vendor-prep: vendor
|
2021-04-14 01:56:40 +02:00
|
|
|
tar -cJf vendor.tar.xz vendor
|
2019-11-30 09:43:01 +01:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: install-tools
|
2023-01-23 10:56:49 +01:00
|
|
|
install-tools: ## install kanidm_tools in your local environment
|
2020-05-02 12:33:52 +02:00
|
|
|
install-tools:
|
2023-03-02 03:47:23 +01:00
|
|
|
cargo install --path tools/cli --force
|
2020-04-11 02:32:56 +02:00
|
|
|
|
2023-01-10 04:50:53 +01:00
|
|
|
.PHONY: codespell
|
2023-05-11 00:30:13 +02:00
|
|
|
codespell: ## spell-check things.
|
2023-01-10 04:50:53 +01:00
|
|
|
codespell:
|
|
|
|
codespell -c \
|
2023-05-25 06:09:23 +02:00
|
|
|
-L 'crate,unexpect,Pres,pres,ACI,aci,te,ue,unx,aNULL' \
|
2023-03-13 01:41:16 +01:00
|
|
|
--skip='./target,./pykanidm/.venv,./pykanidm/.mypy_cache,./.mypy_cache,./pykanidm/poetry.lock' \
|
2023-03-07 02:50:45 +01:00
|
|
|
--skip='./book/book/*' \
|
2023-07-07 10:53:31 +02:00
|
|
|
--skip='./book/src/images/*' \
|
2023-01-10 04:50:53 +01:00
|
|
|
--skip='./docs/*,./.git' \
|
2023-03-13 01:41:16 +01:00
|
|
|
--skip='./rlm_python/mods-available/eap' \
|
2023-06-27 03:38:22 +02:00
|
|
|
--skip='./server/web_ui/static/external,./server/web_ui/pkg/external' \
|
2023-03-02 03:47:23 +01:00
|
|
|
--skip='./server/lib/src/constants/system_config.rs,./pykanidm/site,./server/lib/src/constants/*.json'
|
2023-01-10 04:50:53 +01:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: test/pykanidm/pytest
|
2023-01-23 10:56:49 +01:00
|
|
|
test/pykanidm/pytest: ## python library testing
|
2022-06-20 12:16:55 +02:00
|
|
|
cd pykanidm && \
|
|
|
|
poetry install && \
|
|
|
|
poetry run pytest -vv
|
|
|
|
|
2023-01-23 10:56:49 +01:00
|
|
|
.PHONY: test/pykanidm/lint
|
|
|
|
test/pykanidm/lint: ## python library linting
|
2022-06-20 12:16:55 +02:00
|
|
|
cd pykanidm && \
|
|
|
|
poetry install && \
|
2023-01-23 10:56:49 +01:00
|
|
|
poetry run ruff tests kanidm
|
2022-06-20 12:16:55 +02:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: test/pykanidm/mypy
|
2023-01-23 10:56:49 +01:00
|
|
|
test/pykanidm/mypy: ## python library type checking
|
2022-06-20 12:16:55 +02:00
|
|
|
cd pykanidm && \
|
|
|
|
poetry install && \
|
|
|
|
echo "Running mypy" && \
|
|
|
|
poetry run mypy --strict tests kanidm
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: test/pykanidm
|
2023-01-23 10:56:49 +01:00
|
|
|
test/pykanidm: ## run the kanidm python module test suite (mypy/lint/pytest)
|
|
|
|
test/pykanidm: test/pykanidm/pytest test/pykanidm/mypy test/pykanidm/lint
|
2022-06-20 12:16:55 +02:00
|
|
|
|
2022-07-20 09:21:40 +02:00
|
|
|
########################################################################
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: doc
|
2022-07-20 09:21:40 +02:00
|
|
|
doc: ## Build the rust documentation locally
|
|
|
|
doc:
|
|
|
|
cargo doc --document-private-items
|
|
|
|
|
2022-12-26 23:52:03 +01:00
|
|
|
.PHONY: doc/format
|
|
|
|
doc/format: ## Format docs and the Kanidm book
|
2023-01-24 00:38:19 +01:00
|
|
|
find . -type f -not -path './target/*' -not -path '*/.venv/*' \
|
|
|
|
-name \*.md \
|
|
|
|
-exec deno fmt --check $(MARKDOWN_FORMAT_ARGS) "{}" +
|
|
|
|
|
|
|
|
.PHONY: doc/format/fix
|
|
|
|
doc/format/fix: ## Fix docs and the Kanidm book
|
|
|
|
find . -type f -not -path './target/*' -not -path '*/.venv/*' \
|
|
|
|
-name \*.md \
|
|
|
|
-exec deno fmt $(MARKDOWN_FORMAT_ARGS) "{}" +
|
2022-12-26 23:52:03 +01:00
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: book
|
2022-08-08 01:55:03 +02:00
|
|
|
book: ## Build the Kanidm book
|
2022-07-20 09:21:40 +02:00
|
|
|
book:
|
|
|
|
cargo doc --no-deps
|
2023-03-02 03:47:23 +01:00
|
|
|
mdbook build book
|
2022-12-29 04:02:51 +01:00
|
|
|
rm -rf ./docs/
|
2023-03-02 03:47:23 +01:00
|
|
|
mv ./book/book/ ./docs/
|
2022-07-20 09:21:40 +02:00
|
|
|
mkdir -p ./docs/rustdoc/${BOOK_VERSION}
|
|
|
|
mv ./target/doc/* ./docs/rustdoc/${BOOK_VERSION}/
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: book_versioned
|
2022-07-20 09:21:40 +02:00
|
|
|
book_versioned:
|
|
|
|
echo "Book version: ${BOOK_VERSION}"
|
|
|
|
rm -rf ./target/doc
|
|
|
|
git switch -c "${BOOK_VERSION}"
|
|
|
|
git pull origin "${BOOK_VERSION}"
|
|
|
|
cargo doc --no-deps --quiet
|
2023-03-02 03:47:23 +01:00
|
|
|
mdbook build book
|
2022-12-29 04:02:51 +01:00
|
|
|
rm -rf ./docs/
|
2022-07-20 09:21:40 +02:00
|
|
|
mkdir -p ./docs
|
2023-03-02 03:47:23 +01:00
|
|
|
mv ./book/book/ ./docs/${BOOK_VERSION}/
|
2022-07-20 09:21:40 +02:00
|
|
|
mkdir -p ./docs/${BOOK_VERSION}/rustdoc/
|
|
|
|
mv ./target/doc/* ./docs/${BOOK_VERSION}/rustdoc/
|
|
|
|
git switch master
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: clean_book
|
2022-07-20 09:21:40 +02:00
|
|
|
clean_book:
|
|
|
|
rm -rf ./docs
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: docs/pykanidm/build
|
2022-06-20 12:16:55 +02:00
|
|
|
docs/pykanidm/build: ## Build the mkdocs
|
|
|
|
docs/pykanidm/build:
|
|
|
|
cd pykanidm && \
|
|
|
|
poetry install && \
|
|
|
|
poetry run mkdocs build
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: docs/pykanidm/serve
|
2022-06-20 12:16:55 +02:00
|
|
|
docs/pykanidm/serve: ## Run the local mkdocs server
|
|
|
|
docs/pykanidm/serve:
|
|
|
|
cd pykanidm && \
|
|
|
|
poetry install && \
|
2022-07-11 08:33:18 +02:00
|
|
|
poetry run mkdocs serve
|
2022-07-20 09:21:40 +02:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
|
2023-02-17 08:02:01 +01:00
|
|
|
.PHONY: release/prep
|
|
|
|
prep:
|
|
|
|
cargo outdated -R
|
|
|
|
cargo audit
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: release/kanidm
|
2022-07-20 09:21:40 +02:00
|
|
|
release/kanidm: ## Build the Kanidm CLI - ensure you include the environment variable KANIDM_BUILD_PROFILE
|
|
|
|
cargo build -p kanidm_tools --bin kanidm --release
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: release/kanidmd
|
2022-07-20 09:21:40 +02:00
|
|
|
release/kanidmd: ## Build the Kanidm daemon - ensure you include the environment variable KANIDM_BUILD_PROFILE
|
|
|
|
cargo build -p daemon --bin kanidmd --release
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: release/kanidm-ssh
|
2022-07-20 09:21:40 +02:00
|
|
|
release/kanidm-ssh: ## Build the Kanidm SSH tools - ensure you include the environment variable KANIDM_BUILD_PROFILE
|
|
|
|
cargo build --release \
|
|
|
|
--bin kanidm_ssh_authorizedkeys \
|
|
|
|
--bin kanidm_ssh_authorizedkeys_direct
|
|
|
|
|
2022-12-24 06:09:51 +01:00
|
|
|
.PHONY: release/kanidm-unixd
|
2022-07-20 09:21:40 +02:00
|
|
|
release/kanidm-unixd: ## Build the Kanidm UNIX tools - ensure you include the environment variable KANIDM_BUILD_PROFILE
|
|
|
|
release/kanidm-unixd:
|
|
|
|
cargo build -p pam_kanidm --release
|
|
|
|
cargo build -p nss_kanidm --release
|
2023-04-25 14:36:17 +02:00
|
|
|
cargo build --features unix -p kanidm_unix_int --release \
|
|
|
|
--bin kanidm_unixd \
|
2022-07-20 09:21:40 +02:00
|
|
|
--bin kanidm_unixd_tasks \
|
2023-04-26 07:42:23 +02:00
|
|
|
--bin kanidm-unix
|
2023-01-25 00:43:24 +01:00
|
|
|
|
|
|
|
# cert things
|
|
|
|
|
|
|
|
.PHONY: cert/clean
|
|
|
|
cert/clean: ## clean out the insecure cert bits
|
|
|
|
cert/clean:
|
|
|
|
rm -f /tmp/kanidm/*.pem
|
|
|
|
rm -f /tmp/kanidm/*.cnf
|
|
|
|
rm -f /tmp/kanidm/*.csr
|
|
|
|
rm -f /tmp/kanidm/ca.txt*
|
|
|
|
rm -f /tmp/kanidm/ca.{cnf,srl,srl.old}
|
2023-02-28 02:39:39 +01:00
|
|
|
|
|
|
|
.PHONY: webui
|
2023-03-02 03:47:23 +01:00
|
|
|
webui: ## Build the WASM web frontend
|
|
|
|
cd server/web_ui && ./build_wasm_release.sh
|
2023-06-27 03:38:22 +02:00
|
|
|
|
|
|
|
.PHONY: webui/test
|
|
|
|
webui/test: ## Run wasm-pack test
|
|
|
|
cd server/web_ui && wasm-pack test --headless --chrome
|
2023-07-05 14:26:39 +02:00
|
|
|
|
|
|
|
.PHONY: rust/coverage
|
|
|
|
coverage/test: ## Run coverage tests
|
|
|
|
coverage/test:
|
|
|
|
LLVM_PROFILE_FILE="$(PWD)/target/profile/coverage-%p-%m.profraw" RUSTFLAGS="-C instrument-coverage" cargo test $(TESTS)
|
|
|
|
|
|
|
|
.PHONY: coverage/grcov
|
|
|
|
coverage/grcov: ## Run grcov
|
|
|
|
coverage/grcov:
|
|
|
|
rm -rf ./target/coverage/html
|
|
|
|
grcov . --binary-path ./target/debug/deps/ \
|
|
|
|
-s . \
|
|
|
|
-t html \
|
|
|
|
--branch \
|
|
|
|
--ignore-not-existing \
|
|
|
|
--ignore '../*' \
|
|
|
|
--ignore "/*" \
|
|
|
|
--ignore "target/*" \
|
|
|
|
-o target/coverage/html
|
|
|
|
|
|
|
|
.PHONY: coverage
|
|
|
|
coverage: ## Run all the coverage tests
|
|
|
|
coverage: coverage/test coverage/grcov
|
|
|
|
echo "Coverage report is in ./target/coverage/html/index.html"
|