aboutsummaryrefslogtreecommitdiff
path: root/tests/build-explicit-output.sh
blob: 0f2f428db03d1c7f2c8aaf243ff35e90915e7cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
source common.sh

enableFeatures "computed-derivations"
restartDaemon

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)))
'