Log a message when test framework fails to parse cover profile flag

Signed-off-by: Jake Sanders <i@am.so-aweso.me>
This commit is contained in:
Jake Sanders 2021-05-05 16:40:16 +01:00
parent eab7c954a2
commit bb519a59b9
No known key found for this signature in database
GPG Key ID: 7E708D7933B84690

View File

@ -59,7 +59,9 @@ func InitCoverage(name string) {
}
// Set up the unit test framework with the required arguments to activate test coverage.
if err := flag.CommandLine.Parse([]string{"-test.coverprofile", tempCoveragePath()}); err != nil {
cmdLine := []string{"-test.coverprofile", tempCoveragePath()}
if err := flag.CommandLine.Parse(cmdLine); err != nil {
fmt.Printf("Failed to activate test coverage framework (failed to parse command line): %v\n", cmdLine)
panic(err)
}