(ctx context.Context, cmd *cli.Command)
| 237 | } |
| 238 | |
| 239 | func TestActionFunc(ctx context.Context, cmd *cli.Command) error { |
| 240 | tags := cmd.String("tags") |
| 241 | |
| 242 | for _, pkg := range cmd.StringSlice("packages") { |
| 243 | packageName := "github.com/urfave/cli/v3" |
| 244 | |
| 245 | if pkg != "cli" { |
| 246 | packageName = fmt.Sprintf("github.com/urfave/cli/v3/%s", pkg) |
| 247 | } |
| 248 | |
| 249 | args := []string{"test"} |
| 250 | if tags != "" { |
| 251 | args = append(args, []string{"-tags", tags}...) |
| 252 | } |
| 253 | |
| 254 | args = append(args, []string{ |
| 255 | "-v", |
| 256 | "-race", |
| 257 | "--coverprofile", pkg + ".coverprofile", |
| 258 | "--covermode", "atomic", |
| 259 | "--cover", packageName, |
| 260 | packageName, |
| 261 | }...) |
| 262 | |
| 263 | if err := runCmd(ctx, "go", args...); err != nil { |
| 264 | return err |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | return testCleanup(cmd.StringSlice("packages")) |
| 269 | } |
| 270 | |
| 271 | func testCleanup(packages []string) error { |
| 272 | out := &bytes.Buffer{} |
nothing calls this directly
no test coverage detected