tester_context

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TesterContext

type TesterContext struct {
	// SubmissionDir is the directory containing the student's submission
	SubmissionDir string

	// ExecutablePath is the path to the executable (may be empty if ExecutableFileName is not set)
	ExecutablePath string

	IsDebug                      bool
	TestCases                    []TesterContextTestCase
	ShouldSkipAntiCheatTestCases bool
}

TesterContext holds all flags passed in via environment variables, or from the byteforge.yml file

func GetTesterContext

func GetTesterContext(env map[string]string, definition tester_definition.TesterDefinition) (TesterContext, error)

GetTesterContext parses flags and returns a Context object 支持三种模式: 1. BYTEFORGE_TEST_CASES_JSON - 完整 JSON 格式(兼容 worker 调度) 2. BYTEFORGE_STAGE - 指定单个 stage slug(调试用) 3. 无环境变量 - 运行所有测试(默认行为)

BYTEFORGE_REPOSITORY_DIR 默认为当前目录 "."

func (TesterContext) Print

func (c TesterContext) Print()

type TesterContextTestCase

type TesterContextTestCase struct {
	// Slug is the slug of the test case. Example: "bind-to-port"
	Slug string `json:"slug"`

	// TesterLogPrefix is the prefix that'll be used for all logs emitted by the tester. Example: "stage-1"
	TesterLogPrefix string `json:"tester_log_prefix"`

	// Title is the title of the test case. Example: "Stage #1: Bind to a port"
	Title string `json:"title"`
}

TesterContextTestCase represents one element in the BYTEFORGE_TEST_CASES environment variable

Jump to

Keyboard shortcuts

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