1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 10:11:47 +02:00

Fix test failures when $TMPDIR changes

This commit is contained in:
Eelco Dolstra 2019-05-07 21:15:45 +02:00
parent b9c016abc1
commit c38c726eb5
4 changed files with 8 additions and 10 deletions

View file

@ -27,13 +27,13 @@ output=$(nix-shell --pure --keep SELECTED_IMPURE_VAR shell.nix -A shellDrv --run
# Test nix-shell on a .drv symlink
# Legacy: absolute path and .drv extension required
nix-instantiate shell.nix -A shellDrv --indirect --add-root shell.drv
[[ $(nix-shell --pure $PWD/shell.drv --run \
nix-instantiate shell.nix -A shellDrv --indirect --add-root $TEST_ROOT/shell.drv
[[ $(nix-shell --pure $TEST_ROOT/shell.drv --run \
'echo "$IMPURE_VAR - $VAR_FROM_STDENV_SETUP - $VAR_FROM_NIX"') = " - foo - bar" ]]
# New behaviour: just needs to resolve to a derivation in the store
nix-instantiate shell.nix -A shellDrv --indirect --add-root shell
[[ $(nix-shell --pure shell --run \
nix-instantiate shell.nix -A shellDrv --indirect --add-root $TEST_ROOT/shell
[[ $(nix-shell --pure $TEST_ROOT/shell --run \
'echo "$IMPURE_VAR - $VAR_FROM_STDENV_SETUP - $VAR_FROM_NIX"') = " - foo - bar" ]]
# Test nix-shell -p