chore: initial prototype

This commit is contained in:
technofab 2025-05-03 22:05:29 +02:00
commit c1c19c324d
16 changed files with 1099 additions and 0 deletions

31
lib/default.nix Normal file
View file

@ -0,0 +1,31 @@
{pkgs, ...}: {
mkTest = {
type ? "unit",
name,
description ? "",
expected ? null,
actual ? null,
actualDrv ? null,
pos ? null,
}: {
inherit type name description expected actual;
actualDrv = actualDrv.drvPath or "";
pos =
if pos == null
then ""
else "${pos.file}:${toString pos.line}:${toString pos.column}";
};
mkSuite = name: tests: {
inherit name tests;
};
exportSuites = suites: let
suitesList =
if builtins.isList suites
then suites
else [suites];
testsMapped = builtins.toJSON suitesList;
in
pkgs.runCommand "tests.json" {} ''
echo '${testsMapped}' > $out
'';
}