mirror of
https://github.com/NixOS/nix
synced 2025-06-25 02:21:16 +02:00
Add test for output warning to ensure stability
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
This commit is contained in:
parent
ce89c8c114
commit
d80f0fb15a
2 changed files with 34 additions and 0 deletions
|
@ -33,6 +33,7 @@ suites += {
|
||||||
'debugger.sh',
|
'debugger.sh',
|
||||||
'source-paths.sh',
|
'source-paths.sh',
|
||||||
'old-lockfiles.sh',
|
'old-lockfiles.sh',
|
||||||
|
'trace-ifd.sh',
|
||||||
],
|
],
|
||||||
'workdir': meson.current_source_dir(),
|
'workdir': meson.current_source_dir(),
|
||||||
}
|
}
|
||||||
|
|
33
tests/functional/flakes/trace-ifd.sh
Normal file
33
tests/functional/flakes/trace-ifd.sh
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source ./common.sh
|
||||||
|
|
||||||
|
requireGit
|
||||||
|
|
||||||
|
flake1Dir="$TEST_ROOT/flake"
|
||||||
|
|
||||||
|
createGitRepo "$flake1Dir"
|
||||||
|
createSimpleGitFlake "$flake1Dir"
|
||||||
|
|
||||||
|
cat > "$flake1Dir/flake.nix" <<'EOF'
|
||||||
|
{
|
||||||
|
outputs = { self }: let inherit (import ./config.nix) mkDerivation; in {
|
||||||
|
drv = mkDerivation {
|
||||||
|
name = "drv";
|
||||||
|
buildCommand = ''
|
||||||
|
echo drv >$out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
ifd = mkDerivation {
|
||||||
|
name = "ifd";
|
||||||
|
buildCommand = ''
|
||||||
|
echo ${builtins.readFile self.drv} >$out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
nix build --no-link "$flake1Dir#ifd" --option trace-import-from-derivation true 2>&1 \
|
||||||
|
| grepQuiet 'warning: built .* during evaluation due to an import from derivation'
|
Loading…
Add table
Add a link
Reference in a new issue