mirror of
https://github.com/NixOS/nix.git
synced 2024-10-31 06:10:59 +00:00
move test to correct file
This commit is contained in:
parent
53c15336b0
commit
52359ca00a
@ -56,6 +56,18 @@ cat > $flake1Dir/flake.nix <<EOF
|
||||
a12 = self.drvCall.outPath;
|
||||
|
||||
a13 = "\${self.drvCall.drvPath}\${self.drvCall.outPath}";
|
||||
|
||||
a14 = with import ./config.nix; mkDerivation {
|
||||
name = "dot-installable";
|
||||
outputs = [ "foo" "out" ];
|
||||
meta.outputsToInstall = [ "out" ];
|
||||
buildCommand = ''
|
||||
mkdir \$foo \$out
|
||||
echo "foo" > \$foo/file
|
||||
echo "out" > \$out/file
|
||||
'';
|
||||
outputSpecified = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
EOF
|
||||
@ -94,3 +106,10 @@ nix build --json --out-link $TEST_ROOT/result $flake1Dir#a12
|
||||
|
||||
expectStderr 1 nix build --impure --json --out-link $TEST_ROOT/result $flake1Dir#a13 \
|
||||
| grepQuiet "has 2 entries in its context. It should only have exactly one entry"
|
||||
|
||||
# Test accessing output in installables with `.` (foobarbaz.<output>)
|
||||
nix build --json --no-link $flake1Dir#a14.foo | jq --exit-status '
|
||||
(.[0] |
|
||||
(.drvPath | match(".*dot-installable.drv")) and
|
||||
(.outputs | keys == ["foo"]))
|
||||
'
|
||||
|
@ -285,35 +285,6 @@ git -C "$flake3Dir" add flake.lock
|
||||
|
||||
git -C "$flake3Dir" commit -m 'Add lockfile'
|
||||
|
||||
# Test accessing output in installables with `.` (foobarbaz.<output>)
|
||||
cat > "$flake3Dir/flake.nix" <<EOF
|
||||
{
|
||||
outputs = {self}: {
|
||||
packages.$system.hello = (import ./config.nix).mkDerivation {
|
||||
name = "hello";
|
||||
outputs = [ "foo" "out" ];
|
||||
meta.outputsToInstall = [ "out" ];
|
||||
buildCommand = ''
|
||||
mkdir \$foo \$out
|
||||
echo "foo" > \$foo/file
|
||||
echo "out" > \$out/file
|
||||
'';
|
||||
outputSpecified = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
EOF
|
||||
|
||||
cp ../config.nix "$flake3Dir"
|
||||
git -C "$flake3Dir" add flake.nix config.nix
|
||||
git -C "$flake3Dir" commit -m 'multi outputs flake'
|
||||
|
||||
nix build "$flake3Dir#hello.foo" --json --no-link | jq --exit-status '
|
||||
(.[0] |
|
||||
(.drvPath | match(".*hello.drv")) and
|
||||
(.outputs | keys == ["foo"]))
|
||||
'
|
||||
|
||||
# Test whether registry caching works.
|
||||
nix registry list --flake-registry "file://$registry" | grepQuiet flake3
|
||||
mv "$registry" "$registry.tmp"
|
||||
|
Loading…
Reference in New Issue
Block a user