1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00
This commit is contained in:
Eelco Dolstra 2018-02-13 12:15:27 +01:00
commit 1c10a74c73
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
24 changed files with 122 additions and 3 deletions

View file

@ -22,7 +22,8 @@ nix_tests = \
run.sh \
brotli.sh \
pure-eval.sh \
check.sh
check.sh \
plugins.sh
# parallel.sh
install-tests += $(foreach x, $(nix_tests), tests/$(x))
@ -31,4 +32,4 @@ tests-environment = NIX_REMOTE= $(bash) -e
clean-files += $(d)/common.sh
installcheck: $(d)/common.sh
installcheck: $(d)/common.sh $(d)/plugins/plugintest.so

7
tests/plugins.sh Normal file
View file

@ -0,0 +1,7 @@
source common.sh
set -o pipefail
res=$(nix eval '(builtins.constNull true)' --option plugin-files $PWD/plugins/plugintest.so)
[ "$res"x = "nullx" ]

9
tests/plugins/local.mk Normal file
View file

@ -0,0 +1,9 @@
libraries += plugintest
plugintest_DIR := $(d)
plugintest_SOURCES := $(d)/plugintest.cc
plugintest_ALLOW_UNDEFINED := 1
plugintest_EXCLUDE_FROM_LIBRARY_LIST := 1

View file

@ -0,0 +1,10 @@
#include "primops.hh"
using namespace nix;
static void prim_constNull (EvalState & state, const Pos & pos, Value ** args, Value & v)
{
mkNull(v);
}
static RegisterPrimOp r("constNull", 1, prim_constNull);