Files
judge/example/showcase/04-limits-scoring-env.jdg
Mikhail Kornilovich 7ec3a43c7a
All checks were successful
build-dsl-smoke / Build judge (push) Successful in 12s
build-dsl-smoke / debug / clang / linux (push) Successful in 6s
build-dsl-smoke / debug / gcc / linux (push) Successful in 8s
build-dsl-smoke / release / clang / linux (push) Successful in 8s
build-dsl-smoke / release / gcc / linux (push) Successful in 6s
build-dsl-smoke / sanitized / clang / linux (push) Successful in 8s
build-dsl-smoke / sanitized / gcc / linux (push) Successful in 7s
build-dsl-smoke / debug / clang / windows (push) Successful in 13s
build-dsl-smoke / debug-valgrind / gcc / linux (push) Successful in 14s
build-dsl-smoke / release / clang / windows (push) Successful in 16s
build-dsl-smoke / debug / msvc / windows (push) Successful in 18s
build-dsl-smoke / release / msvc / windows (push) Successful in 17s
build-dsl-smoke / SUMMARY (push) Successful in 4s
Release / Build & publish (push) Successful in 48s
1. New build system
Reviewed-on: #1
2026-04-12 07:59:38 +00:00

78 lines
2.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Тонкая настройка: timeout и memory_limit на разных уровнях (file → group
// → test), режимы скоринга (partial / all_or_none), переменные окружения,
// проверка exit code, передача аргументов.
toolchains {
gcc { platforms = "linux" }
}
build "release" {
language = "c"
standard = "c11"
sources = "solution.c"
output = "solution"
profile = release
}
// Глобальные дефолты. Применяются к каждому тесту, если тот не
// переопределит у себя или на уровне группы.
timeout 5s
memory_limit = 256M
normalize_crlf = true // стрип \r перед сравнением — полезно на Windows
trim_trailing_ws = true // trim trailing space/tab на каждой строке
group("strict-subset") {
weight = 0.4
scoring = all_or_none // группа даёт weight или 0 — без частичного
// Эти дефолты применятся к каждому тесту группы.
timeout = 2s
memory_limit = 64M
env("LC_ALL") = "C"
env("LANG") = "C"
test("fast") {
args = "--mode" "fast"
stdout = "ok\n"
}
test("strict-timeout") {
timeout = 500ms // переопределяет group timeout
stdout = "ok\n"
}
test("high-memory") {
memory_limit = 128M // переопределяет group memory_limit
stdout = "ok\n"
}
test("own-env") {
env("FOO") = "bar" // добавляется к group env
stdout = "ok\n"
}
}
group("partial-credit") {
weight = 0.6
scoring = partial // default: weight * passed/total
test("case-1") {
stdin = "1\n"
stdout = "1\n"
exitCode = 0
}
test("case-2") {
stdin = "2\n"
stdout = "4\n"
exitCode = 0
}
test("case-error") {
// Программа ДОЛЖНА выйти с кодом 1 на плохом вводе.
stdin = "abc\n"
exitCode = 1
stderr contains "invalid input"
}
}