From d97a03c7c6d723587b6c35c8cbd8b69101d7e93f Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 27 Mar 2025 23:43:13 +0900 Subject: test/sandbox: separate test tool source This improves readability and allows gofmt to format the file. Signed-off-by: Ophestra --- test/sandbox/case/default.nix | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'test/sandbox/case/default.nix') diff --git a/test/sandbox/case/default.nix b/test/sandbox/case/default.nix index d00eabf9..c4bfb401 100644 --- a/test/sandbox/case/default.nix +++ b/test/sandbox/case/default.nix @@ -1,12 +1,14 @@ -{ - lib, - callPackage, - writeText, - foot, - - version, -}: +pkgs: version: let + inherit (pkgs) + lib + writeText + buildGoModule + pkg-config + util-linux + foot + ; + fs = mode: dir: data: { mode = lib.fromHexString mode; inherit @@ -30,7 +32,21 @@ let ; }; - checkSandbox = callPackage ../assert.nix { inherit version; }; + checkSandbox = buildGoModule { + pname = "check-sandbox"; + inherit version; + + src = ../../.; + vendorHash = null; + + buildInputs = [ util-linux ]; + nativeBuildInputs = [ pkg-config ]; + + preBuild = '' + go mod init git.gensokyo.uk/security/fortify/test >& /dev/null + cp ${./main.go} main.go + ''; + }; callTestCase = path: -- cgit v1.3.1