feat(runner): compile Go and check answers per test group
This commit is contained in:
1 parent
e95c681165
commit
afee564bf4
61 files changed
+2592
-143
No files matched your search
@@ -168,9 +168,10 @@ RunRequest:
|
||||
$ref: '#/TestGroup'
|
||||
RunLanguage:
|
||||
type: string
|
||||
description: Language and runtime of the source. `python3` runs the Python 3 interpreter of the runner image with isolated mode and no bytecode writes; a syntax check runs first and fails with compile_error.
|
||||
description: Language and runtime of the source. `python3` runs the Python 3 interpreter of the runner image with isolated mode and no bytecode writes; a syntax check runs first and fails with compile_error. `go` compiles one `package main` file with the Go toolchain of the runner image against a prebuilt standard library (no modules, no cgo, no network) in a separate compile phase with its own limits; a compile or link error is compile_error and no test runs.
|
||||
enum:
|
||||
- python3
|
||||
- go
|
||||
RunLimits:
|
||||
type: object
|
||||
description: Limits applied to every test of the run.
|
||||
@@ -234,21 +235,55 @@ TestVisibility:
|
||||
- hidden
|
||||
Checker:
|
||||
type: object
|
||||
description: How the standard output of a test is compared with `expected_output`. Future kinds, such as a float tolerance or a custom checker, add a `kind` value and their own optional parameters to this object.
|
||||
description: How the standard output of a test is compared with `expected_output`. `numbers` requires `abs_tolerance`, `rel_tolerance`, or both; `custom` requires `program`. Other kinds take no parameter. New kinds add a `kind` value and their own optional parameters.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- kind
|
||||
properties:
|
||||
kind:
|
||||
$ref: '#/CheckerKind'
|
||||
abs_tolerance:
|
||||
type: number
|
||||
format: double
|
||||
minimum: 0
|
||||
maximum: 1000000000
|
||||
description: Largest accepted absolute difference of two numeric tokens.
|
||||
rel_tolerance:
|
||||
type: number
|
||||
format: double
|
||||
minimum: 0
|
||||
maximum: 1
|
||||
description: Largest accepted difference of two numeric tokens relative to the expected value.
|
||||
program:
|
||||
$ref: '#/CheckerProgram'
|
||||
CheckerProgram:
|
||||
type: object
|
||||
description: 'Checker program of the task family. It runs in the sandbox with the same isolation as the solution and fixed limits of its own (5 s CPU, 256 MiB). Its arguments are the paths of three read-only files: the test input, the expected output, and the actual output. Exit status 0 accepts, 1 rejects, and anything else, a signal, or a limit is a checker failure, which makes the run infrastructure_failure. Its own output is discarded and never returned.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- language
|
||||
- source
|
||||
properties:
|
||||
language:
|
||||
$ref: '#/RunLanguage'
|
||||
source:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 65536
|
||||
CheckerKind:
|
||||
type: string
|
||||
description: '- exact: both texts are equal after replacing CRLF with LF, removing trailing spaces and tabs at the end of each line, and removing trailing empty lines.
|
||||
|
||||
- tokens: both texts split on ASCII whitespace give the same sequence of tokens.'
|
||||
- tokens: both texts split on ASCII whitespace give the same sequence of tokens.
|
||||
|
||||
- numbers: like tokens, but two finite numeric tokens are equal when their difference is within abs_tolerance or within rel_tolerance times the expected value; other tokens must be equal.
|
||||
|
||||
- custom: the checker program of the task family decides in the sandbox.'
|
||||
enum:
|
||||
- exact
|
||||
- tokens
|
||||
- numbers
|
||||
- custom
|
||||
TestCase:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
||||
@@ -37,9 +37,14 @@ schemas:
|
||||
description: >-
|
||||
Language and runtime of the source. `python3` runs the Python 3
|
||||
interpreter of the runner image with isolated mode and no bytecode
|
||||
writes; a syntax check runs first and fails with compile_error.
|
||||
writes; a syntax check runs first and fails with compile_error. `go`
|
||||
compiles one `package main` file with the Go toolchain of the runner
|
||||
image against a prebuilt standard library (no modules, no cgo, no
|
||||
network) in a separate compile phase with its own limits; a compile
|
||||
or link error is compile_error and no test runs.
|
||||
enum:
|
||||
- python3
|
||||
- go
|
||||
RunLimits:
|
||||
type: object
|
||||
description: Limits applied to every test of the run.
|
||||
@@ -120,22 +125,64 @@ schemas:
|
||||
type: object
|
||||
description: >-
|
||||
How the standard output of a test is compared with `expected_output`.
|
||||
Future kinds, such as a float tolerance or a custom checker, add a
|
||||
`kind` value and their own optional parameters to this object.
|
||||
`numbers` requires `abs_tolerance`, `rel_tolerance`, or both; `custom`
|
||||
requires `program`. Other kinds take no parameter. New kinds add a
|
||||
`kind` value and their own optional parameters.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- kind
|
||||
properties:
|
||||
kind:
|
||||
$ref: "#/schemas/CheckerKind"
|
||||
abs_tolerance:
|
||||
type: number
|
||||
format: double
|
||||
minimum: 0
|
||||
maximum: 1000000000
|
||||
description: Largest accepted absolute difference of two numeric tokens.
|
||||
rel_tolerance:
|
||||
type: number
|
||||
format: double
|
||||
minimum: 0
|
||||
maximum: 1
|
||||
description: >-
|
||||
Largest accepted difference of two numeric tokens relative to the
|
||||
expected value.
|
||||
program:
|
||||
$ref: "#/schemas/CheckerProgram"
|
||||
CheckerProgram:
|
||||
type: object
|
||||
description: >-
|
||||
Checker program of the task family. It runs in the sandbox with the
|
||||
same isolation as the solution and fixed limits of its own (5 s CPU,
|
||||
256 MiB). Its arguments are the paths of three read-only files: the
|
||||
test input, the expected output, and the actual output. Exit status 0
|
||||
accepts, 1 rejects, and anything else, a signal, or a limit is a
|
||||
checker failure, which makes the run infrastructure_failure. Its own
|
||||
output is discarded and never returned.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- language
|
||||
- source
|
||||
properties:
|
||||
language:
|
||||
$ref: "#/schemas/RunLanguage"
|
||||
source:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 65536
|
||||
CheckerKind:
|
||||
type: string
|
||||
description: |-
|
||||
- exact: both texts are equal after replacing CRLF with LF, removing trailing spaces and tabs at the end of each line, and removing trailing empty lines.
|
||||
- tokens: both texts split on ASCII whitespace give the same sequence of tokens.
|
||||
- numbers: like tokens, but two finite numeric tokens are equal when their difference is within abs_tolerance or within rel_tolerance times the expected value; other tokens must be equal.
|
||||
- custom: the checker program of the task family decides in the sandbox.
|
||||
enum:
|
||||
- exact
|
||||
- tokens
|
||||
- numbers
|
||||
- custom
|
||||
TestCase:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
||||
Reference in new issue
Block a user