summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-06-27 23:29:43 +0200
committertv <tv@krebsco.de>2017-06-27 23:32:50 +0200
commitf61a6d03e3ad27b18fcf96f586717ba99c588c4a (patch)
tree15ae1e7813360dc2a70eb1d537f7b0b69af0f985
parent62638ad7f17a4ed536a1842e36130c264d1e2bc2 (diff)
make test: use build and evaluate
-rw-r--r--Makefile11
1 files changed, 5 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index ecc2f493d..cab53d52a 100644
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,8 @@ evaluate = \
--show-trace \
-I nixos-config=$(nixos-config) \
-I stockholm=$(stockholm) \
- -E "let eval = import <stockholm>; in with eval; $(1)"
+ -E "let eval = import <stockholm>; in with eval; $(1)" \
+ $(2)
ifeq ($(MAKECMDGOALS),)
$(error No goals specified)
@@ -132,10 +133,10 @@ install:
# usage: make test system=foo [target=bar] [method={eval,build}]
method ?= eval
ifeq ($(method),build)
-test: command = nix-build --no-out-link
+test: test = $(call build,$(1),$(2))
else
ifeq ($(method),eval)
-test: command ?= nix-instantiate --eval --json --readonly-mode --strict
+test: test ?= $(call evaluate,$(1),$(2)) --json --strict | jq -r .
else
$(error bad method: $(method))
endif
@@ -147,6 +148,4 @@ else
test: wrapper = $(ssh) $(target_user)@$(target_host) -p $(target_port)
endif
test: populate
- $(wrapper) \
- $(command) --show-trace -I $(target_path) \
- -A config.system.build.toplevel $(target_path)/stockholm
+ $(wrapper) $(call test,config.system.build.toplevel,-I $(target_path))