forked from lix-project/lix
eldritch horrors
859da103ae
Fix `logging.sh` test on macOS (cherry picked from commit94a03a810e
) Change-Id:I65dde18ee53ccded31790e0cf1f836c3ad6dc492
27 lines
630 B
Bash
27 lines
630 B
Bash
source common.sh
|
|
|
|
clearStore
|
|
|
|
path=$(nix-build dependencies.nix --no-out-link)
|
|
|
|
# Test nix-store -l.
|
|
[ "$(nix-store -l $path)" = FOO ]
|
|
|
|
# Test compressed logs.
|
|
clearStore
|
|
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="$(realpath "$(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"
|