lix/tests/build-explicit-output.sh
John Ericson 8499f32fb2 New "indexed" installable syntax: <drvPath>!<outputName>
Being conservative and only doing a single output name for now.
2021-04-06 10:25:09 -04:00

18 lines
478 B
Bash

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.