tests/generated: use runCommandNoCCLocal and structuedAttrs

The former makes the test derivation _slightly_ smaller, the latter
makes the `$errors` stdenv variable slightly more robust.
This commit is contained in:
Matt Sturgeon 2024-09-09 15:58:27 +01:00
parent 9f4c9ea7e4
commit 0f83298f2c
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -1,6 +1,6 @@
{ {
lib, lib,
runCommand, runCommandNoCCLocal,
pkgs, pkgs,
}: }:
let let
@ -81,10 +81,15 @@ let
) )
); );
in in
runCommand "generated-sources-test" { inherit errors; } '' runCommandNoCCLocal "generated-sources-test"
if [ -n "$errors" ]; then {
echo -n "$errors" __structuredAttrs = true;
exit 1 inherit errors;
fi }
touch "$out" ''
'' if [ -n "$errors" ]; then
echo -n "$errors"
exit 1
fi
touch "$out"
''