RunTestlibValidators 运行Testlib的validator校验 (APP入口)
(c *cli.Context)
| 171 | |
| 172 | // RunTestlibValidators 运行Testlib的validator校验 (APP入口) |
| 173 | func RunTestlibValidators(c *cli.Context) error { |
| 174 | configFile := c.Args().Get(0) |
| 175 | _, err := os.Stat(configFile) |
| 176 | if err != nil && os.IsNotExist(err) { |
| 177 | return errors.Errorf("[validator] problem config file (%s) not found", configFile) |
| 178 | } |
| 179 | session, err := executor.NewSession(configFile) |
| 180 | if err != nil { |
| 181 | return err |
| 182 | } |
| 183 | mtype := c.String("type") |
| 184 | mCaseIndex := c.Int("case") |
| 185 | silence := c.Bool("silence") |
| 186 | |
| 187 | LIST := []string{"all", "validator_cases", "test_cases"} |
| 188 | if !utils.Contains(LIST, mtype) { |
| 189 | return errors.Errorf("[validator] unsupport module type") |
| 190 | } |
| 191 | err = runTestlibValidators(&session.JudgeConfig, mtype, mCaseIndex) |
| 192 | if err != nil { |
| 193 | return err |
| 194 | } |
| 195 | return session.SaveConfiguration(!silence) |
| 196 | } |
nothing calls this directly
no test coverage detected