(conf, codeFile, codeLang string)
| 37 | } |
| 38 | |
| 39 | func runJudge(conf, codeFile, codeLang string) (*commonStructs.JudgeResult, error) { |
| 40 | session, err := executor.NewSession(conf) |
| 41 | if err != nil { |
| 42 | return nil, err |
| 43 | } |
| 44 | session.CodeFile = codeFile |
| 45 | session.CodeLangName = codeLang |
| 46 | session.SessionRoot = "/tmp" |
| 47 | session.SessionID = uuid.NewV1().String() |
| 48 | sessionDir, err := utils.GetSessionDir(session.SessionRoot, session.SessionID) |
| 49 | if err != nil { |
| 50 | return nil, err |
| 51 | } |
| 52 | session.SessionDir = sessionDir |
| 53 | defer session.Clean() |
| 54 | // start judge |
| 55 | judgeResult := session.RunJudge() |
| 56 | return &judgeResult, err |
| 57 | } |
| 58 | |
| 59 | func runAPlusB(codeFile, codeLang string) (*commonStructs.JudgeResult, error) { |
| 60 | return runJudge("./data/problems/APlusB/problem.json", codeFile, codeLang) |
no test coverage detected