diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2022-02-06 14:52:04 +0100 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2022-03-24 22:31:52 +0100 |
commit | d02e34ef06e24f98404d7a50130ddced15a12279 (patch) | |
tree | 04c8271015cd8a69ceaac3e4697ee84ade8ba55e | |
parent | c85467a1b65d2a8907fcab3303572f76c071776d (diff) |
Implement regression test for empty logs loaded via `nix log`
-rw-r--r-- | tests/logging.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/logging.sh b/tests/logging.sh index c894ad3ff..1481b9b36 100644 --- a/tests/logging.sh +++ b/tests/logging.sh @@ -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" |