diff options
Diffstat (limited to 'pkgs/populate/tests/lib.sh')
| -rw-r--r-- | pkgs/populate/tests/lib.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/populate/tests/lib.sh b/pkgs/populate/tests/lib.sh index a8f2594..0e2ae28 100644 --- a/pkgs/populate/tests/lib.sh +++ b/pkgs/populate/tests/lib.sh @@ -18,6 +18,14 @@ nix() { command nix --extra-experimental-features 'nix-command flakes' "$@" } +# usage: record ATTRPATH +# Prints what's at ATTRPATH, e.g. sources.x.changed, in the record of the +# last run in the target directory $T, as JSON. +record() { + nix-instantiate --eval --json --strict -E \ + "(builtins.fromJSON (builtins.readFile $T/.populate/run.json)).$1" +} + # Evaluates a flake output without network access to the fixtures, so all # inputs must be in the store. An empty cache directory keeps Nix from # restoring inputs from its fetcher cache. |
