fix aggregate
Some checks failed
judge / Build judge (push) Successful in 10s
judge / Linux / gcc / Debug (push) Successful in 9s
judge / Linux / clang / Release (push) Successful in 12s
judge / Linux / clang / Sanitized (push) Successful in 11s
judge / Linux / gcc / Release (push) Successful in 11s
judge / Linux / gcc / Sanitized (push) Successful in 10s
judge / Linux / gcc / Debug (valgrind) (push) Successful in 17s
judge / Windows / clang / Debug (push) Successful in 1m28s
judge / Windows / clang / Release (push) Successful in 1m24s
judge / Windows / msvc / Release (push) Successful in 1m28s
judge / Windows / msvc / Debug (push) Successful in 1m33s
judge / SUMMARY (push) Failing after 4s

This commit is contained in:
2026-04-06 14:28:51 +03:00
parent cb70adbf09
commit 856d7935b5
3 changed files with 90 additions and 14 deletions

View File

@@ -14,6 +14,7 @@ const usage = `judge — CI/CD testing system for student solutions
Usage:
judge <tests.jdg> <solution-dir> [flags]
judge aggregate <reports-dir>
Flags:
--json output as JSON instead of text
@@ -24,10 +25,15 @@ Flags:
Example:
judge lab1.jdg ./student-solution
judge lab1.jdg ./student-solution --json
judge lab1.jdg ./student-solution --wrapper "valgrind --error-exitcode=99"
judge aggregate reports/
`
func main() {
if len(os.Args) >= 2 && os.Args[1] == "aggregate" {
runAggregate()
return
}
fs := flag.NewFlagSet("judge", flag.ContinueOnError)
fs.SetOutput(os.Stderr)
fs.Usage = func() { fmt.Fprint(os.Stderr, usage) }
@@ -85,6 +91,16 @@ func main() {
}
}
func runAggregate() {
if len(os.Args) < 3 {
fatalf("usage: judge aggregate <reports-dir>")
}
dir := os.Args[2]
if err := reporter.Aggregate(os.Stdout, dir); err != nil {
fatalf("%v", err)
}
}
func fatalf(msg string, args ...any) {
fmt.Fprintf(os.Stderr, "error: "+msg+"\n", args...)
os.Exit(1)