Create notion of "test group", use for local overlay store

This commit is contained in:
John Ericson 2023-05-15 18:13:11 -04:00
parent 1dcb782651
commit 97deb00cbc
3 changed files with 17 additions and 7 deletions

View file

@ -10,6 +10,7 @@ bin-scripts :=
noinst-scripts :=
man-pages :=
install-tests :=
install-tests-groups :=
ifdef HOST_OS
HOST_KERNEL = $(firstword $(subst -, ,$(HOST_OS)))
@ -122,6 +123,14 @@ $(foreach script, $(bin-scripts), $(eval programs-list += $(script)))
$(foreach script, $(noinst-scripts), $(eval programs-list += $(script)))
$(foreach template, $(template-files), $(eval $(call instantiate-template,$(template))))
$(foreach test, $(install-tests), $(eval $(call run-install-test,$(test))))
$(foreach test, $(install-tests), $(eval installcheck: $(test).test))
$(foreach test-group, $(install-tests-groups), \
$(eval installcheck: $(test-group).test-group) \
$(eval .PHONY: $(test-group).test-group) \
$(foreach test, $($(test-group)-tests), \
$(eval $(call run-install-test,$(test))) \
$(eval $(test-group).test-group: $(test).test)))
$(foreach file, $(man-pages), $(eval $(call install-data-in, $(file), $(mandir)/man$(patsubst .%,%,$(suffix $(file))))))

View file

@ -2,10 +2,7 @@
test-deps =
define run-install-test
installcheck: $1.test
define run-install-test $1
.PHONY: $1.test
$1.test: $1 $(test-deps)
@env BASH=$(bash) $(bash) mk/run-test.sh $1 < /dev/null

View file

@ -135,9 +135,13 @@ nix_tests = \
flakes/show.sh \
impure-derivations.sh \
path-from-hash-part.sh \
toString-path.sh \
overlay-local-store/outer.sh \
overlay-local-store/bad-uris.sh
toString-path.sh
overlay-local-store-tests := \
$(d)/overlay-local-store/outer.sh \
$(d)/overlay-local-store/bad-uris.sh
install-tests-groups += overlay-local-store
ifeq ($(HAVE_LIBCPUID), 1)
nix_tests += compute-levels.sh