aboutsummaryrefslogtreecommitdiff
path: root/tests/build-explicit-output.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/build-explicit-output.sh')
-rw-r--r--tests/build-explicit-output.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/build-explicit-output.sh b/tests/build-explicit-output.sh
new file mode 100644
index 000000000..17930c2c0
--- /dev/null
+++ b/tests/build-explicit-output.sh
@@ -0,0 +1,17 @@
+source common.sh
+
+drv=$(nix eval -f multiple-outputs.nix --raw a.drvPath)
+if nix build "$drv!not-an-output" --json; then
+ fail "'not-an-output' should fail to build"
+fi
+
+nix build "$drv!first" --json | jq --exit-status '
+ (.[0] |
+ (.drvPath | match(".*multiple-outputs-a.drv")) and
+ (.outputs |
+ .first and
+ (has("second") | not)))
+'
+# TODO use
+# (.first | match(".*multiple-outputs-a-first")) and
+# once we make it put the result paths in the buildables.