Skip to content

Commit

Permalink
Fix coverage collection with modified COVERAGE_DIR env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Jan 9, 2024
1 parent 00b201b commit 916334f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/core/coverage/lcov_coverage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public class Tool {
package lib_test
import (
"os"
"os/exec"
"path/filepath"
"strings"
Expand All @@ -125,6 +126,8 @@ import (
)
func TestLib(t *testing.T) {
// Test that coverage is collected even if this variable is corrupted by a test.
os.Setenv("COVERAGE_DIR", "invalid")
if !strings.Contains(lib.HelloFromLib(false), "\n") {
t.Error("Expected a newline in the output")
}
Expand Down

0 comments on commit 916334f

Please sign in to comment.