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

Function RunTestlibValidatorCases

client/packmgr/validator.go:122–144  ·  view source on GitHub ↗

RunTestlibValidatorCases 运行validator cases的校验 caseIndex < 0 表示校验全部

(config *structs.JudgeConfiguration, caseIndex int)

Source from the content-addressed store, hash-verified

120// RunTestlibValidatorCases 运行validator cases的校验
121// caseIndex < 0 表示校验全部
122func RunTestlibValidatorCases(config *structs.JudgeConfiguration, caseIndex int) error {
123 validator, err := utils.GetCompiledBinaryFileAbsPath("validator", config.TestLib.ValidatorName, config.ConfigDir)
124 if err != nil {
125 return err
126 }
127 // 执行遍历
128 if caseIndex < 0 {
129 for key := range config.TestLib.ValidatorCases {
130 log.Printf("[validator] run validator case #%d", key)
131 err := runValidatorCase(validator, &config.TestLib.ValidatorCases[key])
132 if err != nil {
133 return err
134 }
135 }
136 } else {
137 log.Printf("[validator] run validator case #%d", caseIndex)
138 err := runValidatorCase(validator, &config.TestLib.ValidatorCases[caseIndex])
139 if err != nil {
140 return err
141 }
142 }
143 return nil
144}
145
146// RunTestCasesInputValidation 运行test cases的校验
147// caseIndex < 0 表示校验全部

Callers 1

runTestlibValidatorsFunction · 0.85

Calls 2

runValidatorCaseFunction · 0.85

Tested by

no test coverage detected