lix/tests/build-explicit-output.sh
John Ericson 0966532dc1 Merge remote-tracking branch 'upstream' into indexed-store-path-outputs
Co-Authored-By: Tom Bereknyei <tomberek@gmail.com>
2022-03-25 16:48:50 +00:00

16 lines
425 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 |
(keys | length == 1) and
(.first | match(".*multiple-outputs-a-first")) and
(has("second") | not)))
'