executor

package
v2.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2021 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Deer executor * (C) 2019 LanceLRQ

Deer executor * (C) 2019-Now LanceLRQ

Index

Constants

This section is empty.

Variables

View Source
var ExtraEnviron = []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)

获取二进制文件的目录

func Max

func Max(x, y int64) int64

func Max32

func Max32(a, b int) int

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
	Timeout int                 // Process timeout (s)
}

评测会话类

func NewSession

func NewSession(configFile string) (*JudgeSession, error)

创建会话对象

func NewSessionWithLog

func NewSessionWithLog(configFile string, print bool, level int) (*JudgeSession, error)

创建一个包含日志的对象

func (*JudgeSession) Clean

func (session *JudgeSession) Clean()

清理案发现场

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 PArgs added in v2.2.0

type PArgs struct {
	Name string
	Args []string
	Attr *process.ProcAttr
}

type ProcessInfo

type ProcessInfo struct {
	Pid     int                `json:"pid"`
	Process *process.Process   `json:"-"`
	Status  syscall.WaitStatus `json:"status"`
	Rusage  *syscall.Rusage    `json:"rusage"`
}

进程信息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL