make test: use build and evaluate
This commit is contained in:
parent
62638ad7f1
commit
f61a6d03e3
11
Makefile
11
Makefile
@ -76,7 +76,8 @@ evaluate = \
|
|||||||
--show-trace \
|
--show-trace \
|
||||||
-I nixos-config=$(nixos-config) \
|
-I nixos-config=$(nixos-config) \
|
||||||
-I stockholm=$(stockholm) \
|
-I stockholm=$(stockholm) \
|
||||||
-E "let eval = import <stockholm>; in with eval; $(1)"
|
-E "let eval = import <stockholm>; in with eval; $(1)" \
|
||||||
|
$(2)
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),)
|
ifeq ($(MAKECMDGOALS),)
|
||||||
$(error No goals specified)
|
$(error No goals specified)
|
||||||
@ -132,10 +133,10 @@ install:
|
|||||||
# usage: make test system=foo [target=bar] [method={eval,build}]
|
# usage: make test system=foo [target=bar] [method={eval,build}]
|
||||||
method ?= eval
|
method ?= eval
|
||||||
ifeq ($(method),build)
|
ifeq ($(method),build)
|
||||||
test: command = nix-build --no-out-link
|
test: test = $(call build,$(1),$(2))
|
||||||
else
|
else
|
||||||
ifeq ($(method),eval)
|
ifeq ($(method),eval)
|
||||||
test: command ?= nix-instantiate --eval --json --readonly-mode --strict
|
test: test ?= $(call evaluate,$(1),$(2)) --json --strict | jq -r .
|
||||||
else
|
else
|
||||||
$(error bad method: $(method))
|
$(error bad method: $(method))
|
||||||
endif
|
endif
|
||||||
@ -147,6 +148,4 @@ else
|
|||||||
test: wrapper = $(ssh) $(target_user)@$(target_host) -p $(target_port)
|
test: wrapper = $(ssh) $(target_user)@$(target_host) -p $(target_port)
|
||||||
endif
|
endif
|
||||||
test: populate
|
test: populate
|
||||||
$(wrapper) \
|
$(wrapper) $(call test,config.system.build.toplevel,-I $(target_path))
|
||||||
$(command) --show-trace -I $(target_path) \
|
|
||||||
-A config.system.build.toplevel $(target_path)/stockholm
|
|
||||||
|
Loading…
Reference in New Issue
Block a user