mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Merge branch 'plugins' of https://github.com/shlevy/nix
This commit is contained in:
commit
1c10a74c73
24 changed files with 122 additions and 3 deletions
|
@ -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
7
tests/plugins.sh
Normal 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
9
tests/plugins/local.mk
Normal 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
|
10
tests/plugins/plugintest.cc
Normal file
10
tests/plugins/plugintest.cc
Normal 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);
|
Loading…
Add table
Add a link
Reference in a new issue