wireguard-go: actually run tests

None of the tests are in the root directory (except for the code
formatting one), so they were never actually run until now.
This commit is contained in:
Winter
2025-04-08 18:43:36 -04:00
parent fc42896d3b
commit 6396e1e882
+15
View File
@@ -38,6 +38,21 @@ buildGoModule (
"-w"
];
# No tests besides the formatting one are in root.
# We can't override subPackages per-phase (and we don't
# want to needlessly build packages that have build
# constraints), so just use the upstream Makefile (that
# runs `go test ./...`) to actually run the tests.
checkPhase = ''
runHook preCheck
export GOFLAGS=''${GOFLAGS//-trimpath/}
make test
runHook postCheck
'';
# Tests require networking.
__darwinAllowLocalNetworking = finalAttrs.doCheck;
postInstall = ''
mv $out/bin/wireguard $out/bin/wireguard-go
'';