1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00
gocsaf/cmd/csaf_checker/main_test.go
Bernhard Reiter 6dada4fd14
Change checker to allow integration test coverage
* Add realMain() to allow a call with test argument redacted.
 * Add main_test to call realMain with arguments after `--`.
2022-04-07 18:02:41 +02:00

21 lines
442 B
Go

package main
import (
"os"
"testing"
)
// call realMain() with Args that skip over params used by "go test"
// allow calls like
// go test -c -vet=off -covermode=atomic -o app.debug
// ./app.debug -test.coverprofile=functest.cov -- --insecure localhost
func TestMain(t *testing.T) {
var endOfTestParams int
for i, a := range os.Args[1:] {
if a == "--" {
endOfTestParams = i + 1
}
}
realMain(os.Args[endOfTestParams+1:])
}