Files
judge/example/c-sum-v2/sum.jdg
Mikhail Kornilovich 128a64a609
All checks were successful
build-dsl-smoke / Discover matrix (push) Successful in 8s
build-dsl-smoke / Build judge (push) Successful in 11s
build-dsl-smoke / ${{ matrix.cell.build }} / ${{ matrix.cell.toolchain }} / ${{ matrix.cell.platform }} (push) Successful in 5s
memory-limit / Build judge (pull_request) Successful in 10s
build-dsl-smoke / SUMMARY (push) Successful in 3s
memory-limit / Linux / gcc (pull_request) Successful in 9s
memory-limit / Linux / clang (pull_request) Successful in 13s
memory-limit / Windows / clang (pull_request) Successful in 16s
memory-limit / Windows / msvc (pull_request) Successful in 17s
add new build system
2026-04-11 01:51:38 +03:00

83 lines
1.6 KiB
Plaintext

// Smoke test for the structured build DSL. Same task as example/c-sum
// (sum of N integers) but described declaratively — no shell strings,
// no per-platform `if /I "%CC%"=="msvc"` branching. The compiler is
// selected via the JUDGE_CC env variable set by the CI matrix.
toolchains {
gcc { platforms = "linux" }
clang { platforms = "linux" "windows" }
msvc { platforms = "windows" }
}
build_defaults {
language = "c"
standard = "c11"
sources = "solution.c"
output = "solution"
warnings = strict
}
build "release" {
profile = release
}
build "debug" {
profile = debug
}
build "sanitized" {
profile = sanitized
sanitize = "address" "undefined"
platforms = "linux"
compilers = "gcc" "clang"
}
build "debug-valgrind" {
profile = debug
wrapper = "valgrind --error-exitcode=99 --leak-check=full -q"
platforms = "linux"
compilers = "gcc"
}
timeout 5s
normalize_crlf = true
trim_trailing_ws = true
group("basic") {
weight = 0.5
test("one number") {
stdin = "1\n42\n"
stdout = "42\n"
}
test("three numbers") {
stdin = "3\n1 2 3\n"
stdout = "6\n"
}
test("negatives") {
stdin = "4\n-1 -2 3 5\n"
stdout = "5\n"
}
test("zero count") {
stdin = "0\n"
stdout = "0\n"
}
}
group("edge") {
weight = 0.5
test("large sum fits in int64") {
stdin = "3\n2000000000 2000000000 2000000000\n"
stdout = "6000000000\n"
}
test("multiline input") {
stdin = "5\n10\n20\n30\n40\n50\n"
stdout = "150\n"
}
}