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 := noinst-scripts :=
man-pages := man-pages :=
install-tests := install-tests :=
install-tests-groups :=
ifdef HOST_OS ifdef HOST_OS
HOST_KERNEL = $(firstword $(subst -, ,$(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 script, $(noinst-scripts), $(eval programs-list += $(script)))
$(foreach template, $(template-files), $(eval $(call instantiate-template,$(template)))) $(foreach template, $(template-files), $(eval $(call instantiate-template,$(template))))
$(foreach test, $(install-tests), $(eval $(call run-install-test,$(test)))) $(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)))))) $(foreach file, $(man-pages), $(eval $(call install-data-in, $(file), $(mandir)/man$(patsubst .%,%,$(suffix $(file))))))

View file

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

View file

@ -135,9 +135,13 @@ nix_tests = \
flakes/show.sh \ flakes/show.sh \
impure-derivations.sh \ impure-derivations.sh \
path-from-hash-part.sh \ path-from-hash-part.sh \
toString-path.sh \ toString-path.sh
overlay-local-store/outer.sh \
overlay-local-store/bad-uris.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) ifeq ($(HAVE_LIBCPUID), 1)
nix_tests += compute-levels.sh nix_tests += compute-levels.sh