Files
judge/example/showcase/05-pattern-expansion.jdg

53 lines
1.6 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.
// Автогенерация тестов из папки с файлами. Удобно когда тестов много и
// вручную выписывать каждый через test("...") { stdin = ... stdout = ... }
// будет слишком громоздко.
//
// Два режима:
// 1) file-glob — пары .in/.ans файлов
// 2) dir-mode — каждый тест лежит в своей подпапке с фиксированными
// именами input/output файлов
toolchains {
gcc { platforms = "linux" }
}
build "release" {
language = "c"
standard = "c11"
sources = "solution.c"
output = "solution"
profile = release
}
// Режим 1: глобы на input и output файлы.
// Тестом становится каждая пара (tests/*.in, tests/*.ans) с совпадающим
// базовым именем. Имя теста — имя файла без расширения.
group("from-files") {
weight = 0.5
pattern {
input = "tests/*.in"
output = "tests/*.ans"
}
}
// Режим 2: каждый тест — подкаталог с фиксированным layout'ом.
// Ожидается структура:
// cases/
// 01-basic/
// input.txt
// expected.txt
// 02-edge/
// input.txt
// expected.txt
// Имя теста — имя подкаталога.
group("from-dirs") {
weight = 0.5
pattern {
dirs = "cases/*"
input = "input.txt"
output = "expected.txt"
}
}