#1537·ginkgo

功能请求: 添加一个子命令,用于列出所有已跳过/待执行的测试

作者: bartsmykla创建于 2025年3月25日更新于 2026年4月29日

func pendingSpecs(args []string, cliConfig types.CLIConfig) { fmt.Println("Scanning for pending...") suites := internal.FindSuites(args, cliConfig, false) if len(suites) == 0 { command.AbortWith("Found no test suites") } for _, suite := range suites { res := fetchPendingFromPackage(suite.Path) if len(res) > 0 { fmt.Printf("%s:\n", suite.PackageName) for _, v := range res { fmt.Printf("\t%s : %s\n", v.pos.String(), v.name) } } } }

type out struct { pos token.Position name string }

func fetchPendingFromPackage(packagePath string) []out { fset := token.NewFileSet() parsedPackages, err := parser.ParseDir(fset, packagePath, nil, 0) command.AbortIfError("Failed to parse package …