Documentation
¶
Index ¶
- func ComputeOutputDiff(expected, actual string) (OutputMatchStatus, []DiffLine)
- type AIDetectionReport
- type AIDictionaryEntryError
- type AIDictionaryMatch
- type AISubmissionResult
- type BannedHit
- type CompareConfig
- type CompileResult
- type DiffLine
- type ExecuteResult
- type FileFingerprint
- type MatchSpan
- type MultiProcessResult
- type OutputMatchStatus
- type PlagiarismResult
- type ProcessResult
- type RunReport
- type ScanResult
- type SimilarityPairResult
- type Span
- type Submission
- type SubmissionResult
- type SubmissionStatus
- type SummaryStats
- type TokenSpan
- type WindowMatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeOutputDiff ¶
func ComputeOutputDiff(expected, actual string) (OutputMatchStatus, []DiffLine)
Computes output diff between expected and actual output
Types ¶
type AIDetectionReport ¶
type AIDetectionReport struct {
SourceFile string
DictionaryEntryCount int
DictionaryUsable int
DictionaryErrors []AIDictionaryEntryError
Results []AISubmissionResult
}
type AIDictionaryEntryError ¶
type AIDictionaryMatch ¶
type AISubmissionResult ¶
type CompareConfig ¶
type CompileResult ¶
type CompileResult struct {
OK bool
Command []string
ExitCode int
Stdout string
Stderr string
DurationMs int64
TimedOut bool
}
func NewCompileResult ¶
type ExecuteResult ¶
type ExecuteResult struct {
OK bool
ExitCode int
Stdout string
Stderr string
Duration time.Duration
TimedOut bool
Args []string
Input string
TestCaseName string
ExpectedExit *int
Passed bool
OutputMatch OutputMatchStatus
OutputDiff []DiffLine
}
func NewExecuteResult ¶
func (ExecuteResult) WithTestCase ¶
func (r ExecuteResult) WithTestCase(name string, expectedExit *int) ExecuteResult
type FileFingerprint ¶
type MultiProcessResult ¶
type MultiProcessResult struct {
Processes map[string]*ProcessResult
Order []string
TotalDuration time.Duration
AllCompleted bool
AllPassed bool
ScenarioName string
}
func NewMultiProcessResult ¶
func NewMultiProcessResult() *MultiProcessResult
func (*MultiProcessResult) AddProcess ¶
func (m *MultiProcessResult) AddProcess(name string, result *ProcessResult)
type OutputMatchStatus ¶
type OutputMatchStatus string
const ( OutputMatchNone OutputMatchStatus = "none" // No expected output file configured OutputMatchPass OutputMatchStatus = "pass" // Output matches expected OutputMatchFail OutputMatchStatus = "fail" // Output differs from expected OutputMatchMissing OutputMatchStatus = "missing" // Expected output file not found )
type PlagiarismResult ¶
type ProcessResult ¶
type RunReport ¶
type RunReport struct {
PolicyName string
Root string
StartedAt time.Time
FinishedAt time.Time
Results []SubmissionResult
Summary SummaryStats
}
func NewRunReport ¶
func NewRunReport(policyName, root string, startedAt, finishedAt time.Time, results []SubmissionResult) RunReport
type ScanResult ¶
type ScanResult struct {
Hits []BannedHit
HitsByFunction map[string][]BannedHit
ParseErrors []string
}
func NewScanResult ¶
func NewScanResult(hits []BannedHit, parseErrors []string) ScanResult
func (ScanResult) TotalHits ¶
func (s ScanResult) TotalHits() int
type SimilarityPairResult ¶
type SimilarityPairResult struct {
AIndex int
BIndex int
Result PlagiarismResult
}
type Submission ¶
func NewSubmission ¶
func NewSubmission(id, path string, cFiles []string) Submission
type SubmissionResult ¶
type SubmissionResult struct {
Submission Submission
Compile CompileResult
Scan ScanResult
Status SubmissionStatus
}
func NewSubmissionResult ¶
func NewSubmissionResult(sub Submission, compile CompileResult, scan ScanResult) SubmissionResult
type SubmissionStatus ¶
type SubmissionStatus string
const ( StatusPending SubmissionStatus = "pending" StatusRunning SubmissionStatus = "running" StatusClean SubmissionStatus = "clean" StatusBanned SubmissionStatus = "banned" StatusFailed SubmissionStatus = "failed" StatusTimedOut SubmissionStatus = "timed_out" StatusError SubmissionStatus = "error" )
type SummaryStats ¶
type WindowMatch ¶
Click to show internal directories.
Click to hide internal directories.