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
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user