aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/default.nix
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-06-07 03:10:36 +0900
committerOphestra <cat@gensokyo.uk>2025-06-07 03:10:36 +0900
commit9a7c81a44e4876f2efde1e2d71a5ffbb0b3e96a8 (patch)
tree80ffd4b7932e5d8efa84319c750c43c2a7faab26 /test/default.nix
parentb7e991de5bfa81bff474d07142555df51202640a (diff)
nix: go generate in src derivation
This saves the generated files in the nix store and exposes them for use by external tools. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/default.nix')
-rw-r--r--test/default.nix13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/default.nix b/test/default.nix
index d53dcfca..385b3433 100644
--- a/test/default.nix
+++ b/test/default.nix
@@ -31,14 +31,13 @@ nixosTest {
{
environment.systemPackages = [
# For go tests:
- (writeShellScriptBin "fortify-go-test" ''
- set -e
- WORK="$(mktemp -ud)"
- cp -r "${self.packages.${system}.fortify.src}" "$WORK"
- chmod -R +w "$WORK"
- cd "$WORK"
+ (writeShellScriptBin "fortify-test" ''
+ cd ${self.packages.${system}.fortify.src}
${fhs}/bin/fortify-fhs -c \
- 'go generate ./... && go test ${if withRace then "-race" else "-count 16"} ./... && touch /tmp/go-test-ok'
+ 'go test ${if withRace then "-race" else "-count 16"} ./...' \
+ &> /tmp/fortify-test.log && \
+ touch /tmp/fortify-test-ok
+ touch /tmp/fortify-test-done
'')
];