Skip to content

Commit

Permalink
proc: move stepping test to their own file (go-delve#3784)
Browse files Browse the repository at this point in the history
Move all tests of the functionality of proc.next,
proc.(*TargetGroup).Next, proc.(*TargetGroup).Step,
proc.(*TargetGroup).StepOut to their own test file.
  • Loading branch information
aarzilli authored Jul 20, 2024
1 parent 56e9b85 commit 64f3d34
Show file tree
Hide file tree
Showing 4 changed files with 1,921 additions and 1,899 deletions.
14 changes: 10 additions & 4 deletions _scripts/gen-backend_test_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ import (
"strings"
)

func main() {
f, err := parser.ParseFile(new(token.FileSet), "pkg/proc/proc_test.go", nil, 0)
func process(path string, skipped map[string]map[string]int) {
f, err := parser.ParseFile(new(token.FileSet), path, nil, 0)
if err != nil {
log.Fatalf("could not compile proc_test.go: %v", err)
}
ntests := 0
skipped := make(map[string]map[string]int)
ast.Inspect(f, func(node ast.Node) bool {
switch node := node.(type) {
case *ast.File:
Expand Down Expand Up @@ -62,10 +61,17 @@ func main() {
}
return false
})
}

func main() {
skipped := make(map[string]map[string]int)
process("pkg/proc/proc_test.go", skipped)
process("pkg/proc/stepping_test.go", skipped)
var fh io.WriteCloser
if len(os.Args) > 1 && os.Args[1] == "-" {
fh = os.Stdout
} else {
var err error
fh, err = os.Create("./Documentation/backend_test_health.md")
if err != nil {
log.Fatalf("could not create backend_test_health.md: %v", err)
Expand All @@ -92,7 +98,7 @@ func main() {
fmt.Fprintf(fh, "\t* %d %s\n", skipped[cond][reason], reason)
}
}
err = fh.Close()
err := fh.Close()
if err != nil {
log.Fatalf("could not close output file: %v", err)
}
Expand Down
Loading

0 comments on commit 64f3d34

Please sign in to comment.