e9fd4389d2
Replace writeReferencesToFile with writeClosure. Make writeClosure accept a list of paths instead of a path. Re-implement with JSON-based exportReferencesGraph interface provided by __structuredAttrs = true. Reword the documentation. Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Co-authored-by: Someone Serge <sergei.kozlukov@aalto.fi>
24 lines
588 B
Nix
24 lines
588 B
Nix
{ lib
|
|
, runCommandLocal
|
|
# Test targets
|
|
, writeClosure
|
|
, samples
|
|
}:
|
|
runCommandLocal "test-trivial-builders-writeClosure-mixed" {
|
|
__structuredAttrs = true;
|
|
references = lib.mapAttrs (n: v: writeClosure [ v ]) samples;
|
|
allRefs = writeClosure (lib.attrValues samples);
|
|
inherit samples;
|
|
meta.maintainers = with lib.maintainers; [
|
|
ShamrockLee
|
|
];
|
|
} ''
|
|
set -eu -o pipefail
|
|
echo >&2 Testing mixed closures...
|
|
echo >&2 Checking all samples "(''${samples[*]})" "$allRefs"
|
|
diff -U3 \
|
|
<(sort <"$allRefs") \
|
|
<(cat "''${references[@]}" | sort | uniq)
|
|
touch "$out"
|
|
''
|