Documentation ¶
Overview ¶
Deer executor * (C) 2019 LanceLRQ
Deer executor * (C) 2019-Now LanceLRQ
Index ¶
- Constants
- Variables
- func CheckRequireFilesExists(config *commonStructs.JudgeConfiguration, configDir string) error
- func CompileSpecialJudgeCodeFile(source, name, binRoot, configDir, libraryDir, lang string) (string, error)
- func GetOrCreateBinaryRoot(config *commonStructs.JudgeConfiguration) (string, error)
- func Max(x, y int64) int64
- func Max32(a, b int) int
- func OpenFile(filePath string, flag int, perm os.FileMode) (*os.File, error)
- type ITimerVal
- type JudgeSession
- func (session *JudgeSession) Clean()
- func (session *JudgeSession) DiffText(result *commonStructs.TestCaseResult) error
- func (session *JudgeSession) GetCompiler(codeStr string) (provider.CodeCompileProviderInterface, error)
- func (session *JudgeSession) JudgeOnce(judgeResult *commonStructs.TestCaseResult)
- func (session *JudgeSession) RunJudge() commonStructs.JudgeResult
- func (session *JudgeSession) SaveConfiguration(userConfirm bool) error
- type ProcessInfo
- type RLimit
- type TimeVal
Constants ¶
View Source
const ( ITimerReal = 0 ITimerVirtual = 1 ITimerVProf = 2 )
定义ITimer的常量,命名规则遵循Linux的原始设定
Variables ¶
View Source
var CommonEnvs = []string{"PYTHONIOENCODING=utf-8"}
定义公共环境变量
Functions ¶
func CheckRequireFilesExists ¶
func CheckRequireFilesExists(config *commonStructs.JudgeConfiguration, configDir string) error
检查配置文件里的所有文件是否存在
func CompileSpecialJudgeCodeFile ¶
func CompileSpecialJudgeCodeFile(source, name, binRoot, configDir, libraryDir, lang string) (string, error)
普通特殊评测的编译方法
func GetOrCreateBinaryRoot ¶
func GetOrCreateBinaryRoot(config *commonStructs.JudgeConfiguration) (string, error)
获取二进制文件的目录
Types ¶
type JudgeSession ¶
type JudgeSession struct { SessionId string // Judge Session Id SessionRoot string // Session Root Directory SessionDir string // Session Directory ConfigFile string // Config file ConfigDir string // Config file dir CodeLangName string // Code file language name CodeFile string // Code File Path LibraryDir string // Compile Library Path for Working Program Commands []string // Executable program commands JudgeConfig commonStructs.JudgeConfiguration // Judge Configurations Compiler provider.CodeCompileProviderInterface // Compiler entity Logger *logger.JudgeLogger // Judge Logger }
评测会话类
func NewSessionWithLog ¶
func NewSessionWithLog(configFile string, print bool, level int) (*JudgeSession, error)
创建一个包含日志的对象
func (*JudgeSession) DiffText ¶
func (session *JudgeSession) DiffText(result *commonStructs.TestCaseResult) error
进行文本比较 Compare the text
func (*JudgeSession) GetCompiler ¶
func (session *JudgeSession) GetCompiler(codeStr string) (provider.CodeCompileProviderInterface, error)
编译文件 如果不设置codeStr,默认会读取配置文件里的code_file字段并打开对应文件
func (*JudgeSession) JudgeOnce ¶
func (session *JudgeSession) JudgeOnce(judgeResult *commonStructs.TestCaseResult)
基于JudgeOptions进行评测调度
func (*JudgeSession) RunJudge ¶
func (session *JudgeSession) RunJudge() commonStructs.JudgeResult
执行评测
func (*JudgeSession) SaveConfiguration ¶
func (session *JudgeSession) SaveConfiguration(userConfirm bool) error
保存评测会话
type ProcessInfo ¶
type ProcessInfo struct { Pid uintptr `json:"pid"` Status syscall.WaitStatus `json:"status"` Rusage syscall.Rusage `json:"rusage"` }
进程信息
Click to show internal directories.
Click to hide internal directories.