| 16 | ) |
| 17 | |
| 18 | func initWorkRoot() error { |
| 19 | _, filename, _, _ := runtime.Caller(1) |
| 20 | workPath, err := filepath.Abs(path.Dir(path.Dir(filename))) |
| 21 | if err != nil { |
| 22 | return err |
| 23 | } |
| 24 | err = os.Chdir(workPath) |
| 25 | if err != nil { |
| 26 | return err |
| 27 | } |
| 28 | err = provider.PlaceCompilerCommands("./compilers.json") |
| 29 | if err != nil { |
| 30 | return err |
| 31 | } |
| 32 | err = constants.PlaceMemorySizeForJIT("./jit_memory.json") |
| 33 | if err != nil { |
| 34 | return err |
| 35 | } |
| 36 | return nil |
| 37 | } |
| 38 | |
| 39 | func runJudge(conf, codeFile, codeLang string) (*commonStructs.JudgeResult, error) { |
| 40 | session, err := executor.NewSession(conf) |