All checks were successful
continuous-integration/drone/push Build is passing
35 lines
659 B
Go
35 lines
659 B
Go
package dummy
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/stage"
|
|
)
|
|
|
|
type Config struct {
|
|
Score int
|
|
Comment string
|
|
}
|
|
|
|
type Dummy struct{}
|
|
|
|
func (e *Dummy) Run(results []stage.ExecutorResult, configAny any) (
|
|
[]stage.ParserResult, error,
|
|
) {
|
|
config, err := stage.DecodeConfig[Config](configAny)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
var res []stage.ParserResult
|
|
for _, result := range results {
|
|
res = append(res, stage.ParserResult{
|
|
Score: config.Score,
|
|
Comment: fmt.Sprintf(
|
|
"%s, executor status: run time: %d ns, memory: %d bytes",
|
|
config.Comment, result.RunTime, result.Memory,
|
|
),
|
|
})
|
|
}
|
|
return res, nil
|
|
}
|