index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Levente Polyak <anthraxx@archlinux.org> | 2024-03-04 23:37:49 +0100 |
---|---|---|
committer | Christian Heusel <christian@heusel.eu> | 2024-03-23 23:57:46 +0100 |
commit | 05bea3e922aa7aec5cba3242d3f34b5c10fad24e (patch) | |
tree | de09c15c36a0860e93eb664f16db694244218cd1 /Makefile | |
parent | de0ea3b2f839c2f6ba074d7401d2a28118680da0 (diff) |
-rw-r--r-- | Makefile | 20 |
@@ -1,4 +1,4 @@ -SHELL=/bin/bash +SHELL=/bin/bash -o pipefail V=1.1.1 BUILDTOOLVER ?= $(V) @@ -52,6 +52,13 @@ ARCHBUILD_LINKS = \ COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*))) +CASES ?= test/case +JOBS ?= $(shell nproc) +BATS_EXTRA_ARGS ?= +BATS_ARGS ?= --jobs $(JOBS) $(BATS_EXTRA_ARGS) --verbose-run +COVERAGE_DIR ?= $(BUILDDIR)/coverage + + all: binprogs library conf completion man binprogs: $(BINPROGS) library: $(LIBRARY) @@ -168,8 +175,17 @@ dist: git archive --format=tar --prefix=devtools-$(V)/ v$(V) | gzip > devtools-$(V).tar.gz gpg --detach-sign --use-agent devtools-$(V).tar.gz +test: binprogs library conf completion man + @mkdir -p $(COVERAGE_DIR) + bats $(BATS_ARGS) $(CASES) | tee $(COVERAGE_DIR)/bats-report.xml + +coverage: binprogs library conf completion man + kcov --include-path=src $(COVERAGE_DIR) bats $(BATS_ARGS) $(CASES) + jq -r '. | ["Percent covered", .percent_covered], ["Covered lines", .covered_lines], ["Total lines", .total_lines], ["Percent low", .percent_low], ["Percent high", .percent_high] | @tsv' \ + $(COVERAGE_DIR)/bats.*/coverage.json + check: $(BINPROGS_SRC) $(LIBRARY_SRC) contrib/completion/bash/devtools.in config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto shellcheck $^ -.PHONY: all binprogs library completion conf man clean install uninstall tag dist upload check +.PHONY: all binprogs library completion conf man clean install uninstall tag dist upload test coverage check .DELETE_ON_ERROR: |