aboutsummaryrefslogtreecommitdiff
path: root/tests/plugins
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-02-13 12:15:27 +0100
committerEelco Dolstra <edolstra@gmail.com>2018-02-13 12:15:27 +0100
commit1c10a74c73e710d164d9e5c527f98b309a6f7b2c (patch)
tree11d7729c31624fe452ef8ee1727bc16b229a2583 /tests/plugins
parentc5cc57e96220cd3ed915875f3b1eeb2ba1f98a30 (diff)
parent88cd2d41acb994684a3e4ead1b1676019f43b4b6 (diff)
Merge branch 'plugins' of https://github.com/shlevy/nix
Diffstat (limited to 'tests/plugins')
-rw-r--r--tests/plugins/local.mk9
-rw-r--r--tests/plugins/plugintest.cc10
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/plugins/local.mk b/tests/plugins/local.mk
new file mode 100644
index 000000000..a5f19b087
--- /dev/null
+++ b/tests/plugins/local.mk
@@ -0,0 +1,9 @@
+libraries += plugintest
+
+plugintest_DIR := $(d)
+
+plugintest_SOURCES := $(d)/plugintest.cc
+
+plugintest_ALLOW_UNDEFINED := 1
+
+plugintest_EXCLUDE_FROM_LIBRARY_LIST := 1
diff --git a/tests/plugins/plugintest.cc b/tests/plugins/plugintest.cc
new file mode 100644
index 000000000..f788c4814
--- /dev/null
+++ b/tests/plugins/plugintest.cc
@@ -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);