检查Input、Output是否存在
(tcase commonStructs.TestCase, configDir string)
| 74 | |
| 75 | // 检查Input、Output是否存在 |
| 76 | func checkTestCaseInputOutput(tcase commonStructs.TestCase, configDir string) error { |
| 77 | _, err := os.Stat(path.Join(configDir, tcase.Input)) |
| 78 | if os.IsNotExist(err) { |
| 79 | return errors.Errorf("test case (%s) input file (%s) not exists", tcase.Handle, tcase.Input) |
| 80 | } |
| 81 | _, err = os.Stat(path.Join(configDir, tcase.Output)) |
| 82 | if os.IsNotExist(err) { |
| 83 | return errors.Errorf("test case (%s) output file (%s) not exists", tcase.Handle, tcase.Output) |
| 84 | } |
| 85 | return nil |
| 86 | } |
| 87 | |
| 88 | // 对一组测试数据运行一次评测 |
| 89 | func (session *JudgeSession) runOneCase(config *commonStructs.JudgeConfiguration, tc commonStructs.TestCase, id string) *commonStructs.TestCaseResult { |