MCPcopy Create free account
hub / github.com/LanceLRQ/deer-executor / RunTestlibValidators

Function RunTestlibValidators

client/packmgr/validator.go:173–196  ·  view source on GitHub ↗

RunTestlibValidators 运行Testlib的validator校验 (APP入口)

(c *cli.Context)

Source from the content-addressed store, hash-verified

171
172// RunTestlibValidators 运行Testlib的validator校验 (APP入口)
173func 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}

Callers

nothing calls this directly

Calls 6

NewSessionFunction · 0.92
ContainsFunction · 0.92
runTestlibValidatorsFunction · 0.85
ErrorfMethod · 0.80
SaveConfigurationMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected