Files
judge/example/showcase/06-files.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

60 lines
2.1 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.
// Тесты, которые общаются через файлы, а не через stdin/stdout.
// file("name") = "content" — файл кладётся в рабочую директорию теста
// перед запуском программы.
// outFile("name") = "content" — после запуска содержимое файла сравнивается
// с ожидаемым (точное совпадение с учётом
// normalize_crlf / trim_trailing_ws).
toolchains {
gcc { platforms = "linux" }
}
build "release" {
language = "c"
standard = "c11"
sources = "solution.c"
output = "solution"
profile = release
}
normalize_crlf = true
trim_trailing_ws = true
group("io") {
weight = 1.0
// Программа читает input.txt, пишет output.txt.
test("copy") {
args = "input.txt" "output.txt"
file("input.txt") = "hello world\n"
outFile("output.txt") = "hello world\n"
}
// Несколько входных и выходных файлов сразу — удобно для задач
// вроде «посчитать сумму по каждой строке и записать в отдельный
// файл».
test("multi-file") {
args = "a.txt" "b.txt" "result.txt"
file("a.txt") = "1 2 3\n"
file("b.txt") = "10 20 30\n"
outFile("result.txt") = "11 22 33\n"
}
// Вложенные пути тоже работают — создаются автоматически.
test("nested") {
args = "data/in.txt" "data/out.txt"
file("data/in.txt") = "payload\n"
outFile("data/out.txt") = "PAYLOAD\n"
}
// Можно комбинировать с stdin/stdout и переменными окружения.
test("combined") {
stdin = "42\n"
args = "config.ini"
env("MODE") = "strict"
file("config.ini") = "threshold=10\n"
stdout = "ok\n"
outFile("log.txt") = "processed 42\n"
}
}