1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

test: Improve layout of helper binaries

This patch moves the test helper binaries to a "one directory per
helper" layout, and also makes them to be ignored in the coverage build
instead of all builds.

With this change, "go build ./..." will build all binaries including the
test helpers, which helps make sure that module manage automation also
considers them. In particular, this makes "go mod tidy" work fine.
This commit is contained in:
Alberto Bertogli
2022-08-27 18:33:33 +01:00
parent 567ad35122
commit 21e8d50df6
11 changed files with 37 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
//go:build ignore
// +build ignore
//go:build !coverage
// +build !coverage
// SMTP connection generator, for testing purposes.
package main

View File

@@ -1,5 +1,5 @@
//go:build ignore
// +build ignore
//go:build !coverage
// +build !coverage
// Generate an HTML visualization of a Go coverage profile.
// Serves a similar purpose to "go tool cover -html", but has a different

View File

@@ -1,5 +1,5 @@
//go:build ignore
// +build ignore
//go:build !coverage
// +build !coverage
// Fetch an URL, and check if the response matches what we expect.
//

View File

@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build ignore
// +build ignore
//go:build !coverage
// +build !coverage
// Generate a self-signed X.509 certificate for a TLS server. Outputs to
// 'cert.pem' and 'key.pem' and will overwrite existing files.

View File

@@ -2,8 +2,8 @@
//
// From: https://git.lukeshu.com/go/cmd/gocovcat/
//
//go:build ignore
// +build ignore
//go:build !coverage
// +build !coverage
// Copyright 2017 Luke Shumaker <lukeshu@parabola.nu>
//

View File

@@ -101,26 +101,29 @@ function chamuyero() {
}
function generate_cert() {
go run ${UTILDIR}/generate_cert.go "$@"
( cd ${UTILDIR}/generate_cert/; go build )
${UTILDIR}/generate_cert/generate_cert "$@"
}
function loadgen() {
go run ${UTILDIR}/loadgen.go "$@"
( cd ${UTILDIR}/loadgen/; go build )
${UTILDIR}/loadgen/loadgen "$@"
}
function conngen() {
go run ${UTILDIR}/conngen.go "$@"
( cd ${UTILDIR}/conngen/; go build )
${UTILDIR}/conngen/conngen "$@"
}
function minidns_bg() {
( cd ${UTILDIR}; go build minidns.go )
${UTILDIR}/minidns "$@" &
( cd ${UTILDIR}/minidns; go build )
${UTILDIR}/minidns/minidns "$@" &
MINIDNS=$!
}
function fexp() {
( cd ${UTILDIR}; go build fexp.go )
${UTILDIR}/fexp "$@"
( cd ${UTILDIR}/fexp/; go build )
${UTILDIR}/fexp/fexp "$@"
}
function timeout() {

View File

@@ -1,5 +1,5 @@
//go:build ignore
// +build ignore
//go:build !coverage
// +build !coverage
// SMTP load generator, for testing purposes.
package main

View File

@@ -1,5 +1,5 @@
//go:build ignore
// +build ignore
//go:build !coverage
// +build !coverage
// minidns is a trivial DNS server used for testing.
//