()
| 555 | } |
| 556 | |
| 557 | func getTestCommand() cli.Command { |
| 558 | return cli.Command{ |
| 559 | Name: "test", |
| 560 | ShortName: "test", |
| 561 | Usage: "Run Gohan script Test", |
| 562 | Description: ` |
| 563 | Run gohan script yaml code.`, |
| 564 | Flags: []cli.Flag{ |
| 565 | cli.StringFlag{Name: "config-file,c", Value: defaultConfigFile, Usage: "config file path"}, |
| 566 | }, |
| 567 | Action: func(c *cli.Context) { |
| 568 | dir := c.Args()[0] |
| 569 | configFile := c.String("config-file") |
| 570 | loadConfig(configFile) |
| 571 | gohanscript.RunTests(dir) |
| 572 | }, |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | func loadConfig(configFile string) { |
| 577 | if configFile == "" { |
no test coverage detected