判定是否是灾难性结果
(judgeResult *commonStructs.JudgeResult, tcResult *commonStructs.TestCaseResult)
| 164 | |
| 165 | // 判定是否是灾难性结果 |
| 166 | func (session *JudgeSession) isDisastrousFault(judgeResult *commonStructs.JudgeResult, tcResult *commonStructs.TestCaseResult) bool { |
| 167 | if tcResult.JudgeResult == constants.JudgeFlagSE { |
| 168 | judgeResult.JudgeResult = constants.JudgeFlagSE |
| 169 | judgeResult.SeInfo = fmt.Sprintf("testcase %s caused a problem", tcResult.Handle) |
| 170 | return true |
| 171 | } |
| 172 | |
| 173 | // 如果是实时运行的语言 |
| 174 | if session.Compiler.IsRealTime() { |
| 175 | outfile, e := ioutil.ReadFile(path.Join(session.SessionDir, tcResult.ProgramError)) |
| 176 | if e == nil { |
| 177 | if len(outfile) > 0 { |
| 178 | remsg := string(outfile) |
| 179 | |
| 180 | if session.Compiler.IsCompileError(remsg) { |
| 181 | tcResult.JudgeResult = constants.JudgeFlagCE |
| 182 | tcResult.CeInfo = remsg |
| 183 | judgeResult.JudgeResult = constants.JudgeFlagCE |
| 184 | judgeResult.CeInfo = remsg |
| 185 | } else { |
| 186 | tcResult.JudgeResult = constants.JudgeFlagRE |
| 187 | tcResult.SeInfo = fmt.Sprintf("%s\n%s\n", tcResult.SeInfo, remsg) |
| 188 | judgeResult.JudgeResult = constants.JudgeFlagRE |
| 189 | judgeResult.SeInfo = tcResult.SeInfo |
| 190 | } |
| 191 | return true |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | return false |
| 196 | } |
| 197 | |
| 198 | // 计算判题结果 |
| 199 | func (session *JudgeSession) generateFinallyResult(result *commonStructs.JudgeResult, exitcodes []int) { |
no test coverage detected