Some checks failed
judge / Build judge (push) Successful in 8s
judge / Linux / gcc / Debug (push) Successful in 7s
judge / Linux / clang / Release (push) Successful in 9s
judge / Linux / gcc / Release (push) Successful in 10s
judge / Linux / clang / Sanitized (push) Successful in 8s
judge / Linux / gcc / Sanitized (push) Successful in 9s
judge / Linux / gcc / Debug (valgrind) (push) Successful in 15s
judge / Windows / clang / Debug (push) Successful in 37s
judge / Windows / clang / Release (push) Successful in 40s
judge / Windows / msvc / Debug (push) Successful in 45s
judge / Windows / msvc / Release (push) Successful in 43s
judge / SUMMARY (push) Failing after 2s
66 lines
929 B
Go
66 lines
929 B
Go
package runner
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
type Status int
|
|
|
|
const (
|
|
StatusPass Status = iota
|
|
StatusFail
|
|
StatusTLE
|
|
StatusBuildError
|
|
StatusRuntimeError
|
|
)
|
|
|
|
func (s Status) String() string {
|
|
switch s {
|
|
case StatusPass:
|
|
return "PASS"
|
|
case StatusFail:
|
|
return "FAIL"
|
|
case StatusTLE:
|
|
return "TLE"
|
|
case StatusBuildError:
|
|
return "BUILD_ERROR"
|
|
case StatusRuntimeError:
|
|
return "RE"
|
|
default:
|
|
return "UNKNOWN"
|
|
}
|
|
}
|
|
|
|
type TestResult struct {
|
|
Name string
|
|
Status Status
|
|
Elapsed time.Duration
|
|
|
|
Failures []string
|
|
|
|
ActualStdout string
|
|
ActualStderr string
|
|
ActualCode int
|
|
}
|
|
|
|
func (r *TestResult) addFailure(msg string, args ...any) {
|
|
r.Failures = append(r.Failures, fmt.Sprintf(msg, args...))
|
|
}
|
|
|
|
type GroupResult struct {
|
|
Name string
|
|
Weight float64
|
|
Score float64
|
|
|
|
Tests []*TestResult
|
|
Passed int
|
|
Total int
|
|
}
|
|
|
|
type SuiteResult struct {
|
|
Groups []*GroupResult
|
|
TotalScore float64
|
|
BuildLog string
|
|
}
|