feat(parser/diff): remove result status check

This commit is contained in:
张泊明518370910136 2024-10-15 03:42:16 -04:00
parent 1ab6fa4583
commit a001b26b66
GPG Key ID: D47306D7062CDA9D

View File

@ -7,7 +7,6 @@ import (
"strings" "strings"
"unicode" "unicode"
"github.com/criyle/go-judge/envexec"
"github.com/joint-online-judge/JOJ3/internal/stage" "github.com/joint-online-judge/JOJ3/internal/stage"
) )
@ -24,7 +23,6 @@ type Conf struct {
PassComment string `default:"🥳Passed!\n"` PassComment string `default:"🥳Passed!\n"`
FailComment string `default:"🧐Failed...\n"` FailComment string `default:"🧐Failed...\n"`
Cases []struct { Cases []struct {
IgnoreResultStatus bool
Outputs []struct { Outputs []struct {
Score int Score int
FileName string FileName string
@ -54,13 +52,6 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
result := results[i] result := results[i]
score := 0 score := 0
comment := "" comment := ""
if !caseConf.IgnoreResultStatus &&
result.Status != stage.Status(envexec.StatusAccepted) {
forceQuit = true
comment += fmt.Sprintf(
"Unexpected executor status: %s.", result.Status,
)
} else {
for _, output := range caseConf.Outputs { for _, output := range caseConf.Outputs {
answer, err := os.ReadFile(output.AnswerPath) answer, err := os.ReadFile(output.AnswerPath)
if err != nil { if err != nil {
@ -101,7 +92,6 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
} }
} }
} }
}
res = append(res, stage.ParserResult{ res = append(res, stage.ParserResult{
Score: score, Score: score,
Comment: comment, Comment: comment,