Files
judge/dsl/ast.go
Mikhail Kornilovich 7f9f6a0a6e
All checks were successful
build-dsl-smoke / Build judge (push) Successful in 13s
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 9s
build-dsl-smoke / release / gcc / linux (push) Successful in 7s
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 16s
build-dsl-smoke / debug-valgrind / gcc / linux (push) Successful in 14s
build-dsl-smoke / debug / msvc / windows (push) Successful in 18s
build-dsl-smoke / release / clang / windows (push) Successful in 17s
build-dsl-smoke / release / msvc / windows (push) Successful in 17s
build-dsl-smoke / SUMMARY (push) Successful in 5s
feat: pattern support args and multiple variants; add zed extension for highlight
2026-04-11 14:37:43 +03:00

116 lines
1.7 KiB
Go

package dsl
import "time"
type File struct {
Build string
BuildLinux string
BuildWindows string
BuildDarwin string
BuildDefaults *BuildConfig
Builds []*BuildConfig
Toolchains []*ToolchainSpec
Timeout time.Duration
MemoryLimit int64
Binary string
Sources string
NormalizeCRLF bool
TrimTrailingWS bool
Groups []*Group
}
type Group struct {
Name string
Weight float64
Timeout time.Duration
MemoryLimit int64
Env map[string]string
Scoring ScoringMode
Wrapper string
Tests []*Test
Pattern *Pattern
}
type ScoringMode int
const (
ScoringPartial ScoringMode = iota
ScoringAllOrNone
)
type Pattern struct {
InputGlob string
OutputGlob string
DirsGlob string
InputFile string
OutputFile string
Args []string
}
func (p *Pattern) IsDirMode() bool {
return p.DirsGlob != ""
}
type Test struct {
Name string
Timeout time.Duration
MemoryLimit int64
Env map[string]string
Wrapper string
Stdin *string
Args []string
InFiles map[string]string
ExitCode *int
Stdout Matcher
Stderr Matcher
OutFiles map[string]string
}
type Matcher interface {
matcherNode()
}
type ExactMatcher struct {
Value string
}
func (ExactMatcher) matcherNode() {}
type ContainsMatcher struct {
Substr string
}
func (ContainsMatcher) matcherNode() {}
type RegexMatcher struct {
Pattern string
}
func (RegexMatcher) matcherNode() {}
type NumericEpsMatcher struct {
Epsilon float64
Value string
}
func (NumericEpsMatcher) matcherNode() {}
type AnyOrderMatcher struct {
Lines []string
}
func (AnyOrderMatcher) matcherNode() {}
type NoMatcher struct{}
func (NoMatcher) matcherNode() {}