Commit 6396e1e8 authored by Winter's avatar Winter
Browse files

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.
parent fc42896d
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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
    '';