feat: add "script" test type

This commit is contained in:
technofab 2025-05-31 17:20:19 +02:00
parent d0e47e305d
commit b50a1c61a6
3 changed files with 59 additions and 2 deletions

View file

@ -12,6 +12,7 @@
expected ? null,
actual ? null,
actualDrv ? null,
script ? null,
pos ? null,
}: let
fileRelative = lib.removePrefix ((toString self) + "/") pos.file;
@ -29,6 +30,10 @@
expected = expected';
# discard string context, otherwise it's being built instantly which we don't want
actualDrv = builtins.unsafeDiscardStringContext (actualDrv.drvPath or "");
script =
if script != null
then builtins.unsafeDiscardStringContext (pkgs.writeShellScript "nixtest-${name}" script).drvPath
else null;
pos =
if pos == null
then ""