mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2025-12-12 02:00:18 +01:00
feat: remove nix store path prefix if used in flakeModule
This commit is contained in:
parent
27696c02bc
commit
482f15c486
2 changed files with 12 additions and 4 deletions
|
|
@ -1,4 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
lib ? pkgs.lib,
|
||||
self ? "",
|
||||
...
|
||||
}: {
|
||||
mkTest = {
|
||||
type ? "unit",
|
||||
name,
|
||||
|
|
@ -7,13 +12,15 @@
|
|||
actual ? null,
|
||||
actualDrv ? null,
|
||||
pos ? null,
|
||||
}: {
|
||||
}: let
|
||||
fileRelative = lib.removePrefix ((toString self) + "/") pos.file;
|
||||
in {
|
||||
inherit type name description expected actual;
|
||||
actualDrv = actualDrv.drvPath or "";
|
||||
pos =
|
||||
if pos == null
|
||||
then ""
|
||||
else "${pos.file}:${toString pos.line}:${toString pos.column}";
|
||||
else "${fileRelative}:${toString pos.line}:${toString pos.column}";
|
||||
};
|
||||
mkSuite = name: tests: {
|
||||
inherit name tests;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue