From 0f83298f2ca5d871ca2dbba0315974e79a8e7dcb Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Mon, 9 Sep 2024 15:58:27 +0100 Subject: [PATCH] tests/generated: use `runCommandNoCCLocal` and `structuedAttrs` The former makes the test derivation _slightly_ smaller, the latter makes the `$errors` stdenv variable slightly more robust. --- tests/generated.nix | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/generated.nix b/tests/generated.nix index 51fe11eb..a82b2a3d 100644 --- a/tests/generated.nix +++ b/tests/generated.nix @@ -1,6 +1,6 @@ { lib, - runCommand, + runCommandNoCCLocal, pkgs, }: let @@ -81,10 +81,15 @@ let ) ); in -runCommand "generated-sources-test" { inherit errors; } '' - if [ -n "$errors" ]; then - echo -n "$errors" - exit 1 - fi - touch "$out" -'' +runCommandNoCCLocal "generated-sources-test" + { + __structuredAttrs = true; + inherit errors; + } + '' + if [ -n "$errors" ]; then + echo -n "$errors" + exit 1 + fi + touch "$out" + ''