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

Function checkTestCaseInputOutput

executor/dispatch.go:76–86  ·  view source on GitHub ↗

检查Input、Output是否存在

(tcase commonStructs.TestCase, configDir string)

Source from the content-addressed store, hash-verified

74
75// 检查Input、Output是否存在
76func checkTestCaseInputOutput(tcase commonStructs.TestCase, configDir string) error {
77 _, err := os.Stat(path.Join(configDir, tcase.Input))
78 if os.IsNotExist(err) {
79 return errors.Errorf("test case (%s) input file (%s) not exists", tcase.Handle, tcase.Input)
80 }
81 _, err = os.Stat(path.Join(configDir, tcase.Output))
82 if os.IsNotExist(err) {
83 return errors.Errorf("test case (%s) output file (%s) not exists", tcase.Handle, tcase.Output)
84 }
85 return nil
86}
87
88// 对一组测试数据运行一次评测
89func (session *JudgeSession) runOneCase(config *commonStructs.JudgeConfiguration, tc commonStructs.TestCase, id string) *commonStructs.TestCaseResult {

Callers 1

runOneCaseMethod · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected