diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-30 21:09:16 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-30 21:09:16 +0900 |
| commit | 89a05909a4fb393864a8aa752f6979dd9aaa2898 (patch) | |
| tree | ac6a0e6e25d7fdeada94bedb45c684aa5b912b73 /test | |
| parent | f772940768d9cada256f8f3291a3b9e9685003c3 (diff) | |
test: move test program to sandbox directory
This prepares for the separation of app and sandbox tests.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test')
| -rw-r--r-- | test/configuration.nix | 32 | ||||
| -rw-r--r-- | test/sandbox/tool/main.go (renamed from test/main.go) | 0 | ||||
| -rw-r--r-- | test/sandbox/tool/package.nix | 30 |
3 files changed, 31 insertions, 31 deletions
diff --git a/test/configuration.nix b/test/configuration.nix index 93f1b39c..96b87a9d 100644 --- a/test/configuration.nix +++ b/test/configuration.nix @@ -5,37 +5,7 @@ ... }: let - testProgram = - let - inherit (pkgs) - buildGoModule - pkg-config - util-linux - ; - in - buildGoModule rec { - pname = "check-sandbox"; - inherit (config.environment.fortify.package) version; - - src = builtins.path { - name = "${pname}-src"; - path = lib.cleanSource ./.; - filter = path: type: (type == "directory" && lib.hasSuffix "sandbox" path) || (type == "regular" && lib.hasSuffix ".go" path); - }; - vendorHash = null; - - buildInputs = [ util-linux ]; - nativeBuildInputs = [ pkg-config ]; - - preBuild = '' - go mod init git.gensokyo.uk/security/fortify/test >& /dev/null - ''; - - postInstall = '' - mv $out/bin/test $out/bin/fortify-test - ''; - }; - + testProgram = pkgs.callPackage ./sandbox/tool/package.nix { inherit (config.environment.fortify.package) version; }; testCases = import ./sandbox/case lib testProgram; in { diff --git a/test/main.go b/test/sandbox/tool/main.go index 4c639b28..4c639b28 100644 --- a/test/main.go +++ b/test/sandbox/tool/main.go diff --git a/test/sandbox/tool/package.nix b/test/sandbox/tool/package.nix new file mode 100644 index 00000000..7cc3472e --- /dev/null +++ b/test/sandbox/tool/package.nix @@ -0,0 +1,30 @@ +{ + lib, + buildGoModule, + pkg-config, + util-linux, + + version, +}: +buildGoModule rec { + pname = "check-sandbox"; + inherit version; + + src = builtins.path { + name = "${pname}-src"; + path = lib.cleanSource ../.; + filter = path: type: (type == "directory") || (type == "regular" && lib.hasSuffix ".go" path); + }; + vendorHash = null; + + buildInputs = [ util-linux ]; + nativeBuildInputs = [ pkg-config ]; + + preBuild = '' + go mod init git.gensokyo.uk/security/fortify/test/sandbox >& /dev/null + ''; + + postInstall = '' + mv $out/bin/tool $out/bin/fortify-test + ''; +} |
