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

Function runJudge

test/util.go:39–57  ·  view source on GitHub ↗
(conf, codeFile, codeLang string)

Source from the content-addressed store, hash-verified

37}
38
39func 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
59func runAPlusB(codeFile, codeLang string) (*commonStructs.JudgeResult, error) {
60 return runJudge("./data/problems/APlusB/problem.json", codeFile, codeLang)

Callers 3

runAPlusBFunction · 0.85
runWJ2018Function · 0.85
runWJ2012Function · 0.85

Calls 5

NewSessionFunction · 0.92
GetSessionDirFunction · 0.92
RunJudgeMethod · 0.80
StringMethod · 0.65
CleanMethod · 0.65

Tested by

no test coverage detected