Skip to content

Commit e8b28c0

Browse files
committed
PR review comments
1 parent 426a8da commit e8b28c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

commands/run.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ var (
3838
red = color.New(color.FgRed).SprintfFunc()
3939
magenta = color.New(color.FgMagenta).SprintfFunc()
4040
yellow = color.New(color.FgYellow).SprintfFunc()
41+
blue = color.New(color.FgBlue).SprintfFunc()
4142
)
4243

4344
const WorkDir = "work"
45+
46+
// Time out delta in miliseconds
4447
const TimeOutDelta float64 = 25.0
4548

4649
// Checks the output of a given testcase against it's expected output
@@ -157,7 +160,7 @@ func getDisplayStatus(status int8) string {
157160
case WA:
158161
return red("WA")
159162
case TL:
160-
return red("TL") // TODO(Eroui): Add another color?
163+
return blue("TL") // TODO(Eroui): Add another color?
161164
}
162165
return "Unknown"
163166
}
@@ -196,6 +199,8 @@ func newJudgeReport() JudgeReport {
196199
return &ConsoleJudgeReport{Stats: []CaseStatus{}}
197200
}
198201

202+
// Utility function to execute a given command and insure to stop it after a timeOut (in miliseconds).
203+
// The function returns the status of the execution, the duration of the exeuction, and an error (if any).
199204
func timedExecution(cmd *exec.Cmd, timeOut float64) (int8, time.Duration, error) {
200205
cmd.Start()
201206
start := time.Now()

0 commit comments

Comments
 (0)