Implement regression test for empty logs loaded via nix log

This commit is contained in:
Maximilian Bosch 2022-02-06 14:52:04 +01:00
parent c85467a1b6
commit d02e34ef06
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -13,3 +13,14 @@ rm -rf $NIX_LOG_DIR
(! nix-store -l $path)
nix-build dependencies.nix --no-out-link --compress-build-log
[ "$(nix-store -l $path)" = FOO ]
# test whether empty logs work fine with `nix log`.
builder="$(mktemp)"
echo -e "#!/bin/sh\nmkdir \$out" > "$builder"
outp="$(nix-build -E \
'with import ./config.nix; mkDerivation { name = "fnord"; builder = '"$builder"'; }' \
--out-link "$(mktemp -d)/result")"
test -d "$outp"
nix log "$outp"