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

Method runOneCase

executor/dispatch.go:89–118  ·  view source on GitHub ↗

对一组测试数据运行一次评测

(config *commonStructs.JudgeConfiguration, tc commonStructs.TestCase, id string)

Source from the content-addressed store, hash-verified

87
88// 对一组测试数据运行一次评测
89func (session *JudgeSession) runOneCase(config *commonStructs.JudgeConfiguration, tc commonStructs.TestCase, id string) *commonStructs.TestCaseResult {
90 session.Logger.Infof("Run test case: %s", id)
91
92 var err error
93
94 tcResult := commonStructs.TestCaseResult{}
95 tcResult.Handle = id
96 // 创建相关的文件路径
97 tcResult.Input = tc.Input
98 tcResult.Output = tc.Output
99 tcResult.ProgramOut = id + "_program.out"
100 tcResult.ProgramError = id + "_program.err"
101 tcResult.CheckerOut = id + "_checker.out"
102 tcResult.CheckerError = id + "_checker.err"
103 tcResult.CheckerReport = id + "_checker.report"
104
105 // 检查测试数据的输入输出文件是否存在
106 err = checkTestCaseInputOutput(tc, config.ConfigDir)
107 if err != nil {
108 tcResult.JudgeResult = constants.JudgeFlagSE
109 tcResult.SeInfo = err.Error()
110 session.Logger.Error(err.Error())
111 return &tcResult
112 }
113
114 // 运行judge程序
115 session.JudgeOnce(&tcResult)
116
117 return &tcResult
118}
119
120// RunJudge 执行评测
121func (session *JudgeSession) RunJudge() commonStructs.JudgeResult {

Callers 1

RunJudgeMethod · 0.95

Calls 4

JudgeOnceMethod · 0.95
checkTestCaseInputOutputFunction · 0.85
InfofMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected