-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #325 from gotestyourself/coverage-go1.20
Fix coverage detection for go1.20
- Loading branch information
Showing
9 changed files
with
420 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//go:build stubpkg | ||
// +build stubpkg | ||
|
||
package good | ||
|
||
func Something() int { | ||
for i := 0; i < 10; i++ { | ||
return i | ||
} | ||
return 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
✖ gotestsum/testjson/internal/badmain (1ms) | ||
∅ gotestsum/testjson/internal/empty (cached) | ||
✓ gotestsum/testjson/internal/good (20ms) (coverage: 66.7% of statements) | ||
✖ gotestsum/testjson/internal/parallelfails (21ms) | ||
✖ gotestsum/testjson/internal/withfails (20ms) |
11 changes: 11 additions & 0 deletions
11
testjson/testdata/format/standard-quiet-coverage-go1.20.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
sometimes main can exit 2 | ||
program not built with -cover | ||
FAIL gotest.tools/gotestsum/testjson/internal/badmain 0.001s | ||
ok gotest.tools/gotestsum/testjson/internal/empty (cached) coverage: [no statements] [no tests to run] | ||
ok gotest.tools/gotestsum/testjson/internal/good 0.020s coverage: 66.7% of statements | ||
FAIL | ||
coverage: [no statements] | ||
FAIL gotest.tools/gotestsum/testjson/internal/parallelfails 0.021s | ||
FAIL | ||
coverage: [no statements] | ||
FAIL gotest.tools/gotestsum/testjson/internal/withfails 0.020s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# gotest.tools/gotestsum/testjson/internal/broken | ||
internal/broken/broken.go:5:21: undefined: somepackage |
Oops, something went wrong.