File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 38
38
red = color .New (color .FgRed ).SprintfFunc ()
39
39
magenta = color .New (color .FgMagenta ).SprintfFunc ()
40
40
yellow = color .New (color .FgYellow ).SprintfFunc ()
41
+ blue = color .New (color .FgBlue ).SprintfFunc ()
41
42
)
42
43
43
44
const WorkDir = "work"
45
+
46
+ // Time out delta in miliseconds
44
47
const TimeOutDelta float64 = 25.0
45
48
46
49
// Checks the output of a given testcase against it's expected output
@@ -157,7 +160,7 @@ func getDisplayStatus(status int8) string {
157
160
case WA :
158
161
return red ("WA" )
159
162
case TL :
160
- return red ("TL" ) // TODO(Eroui): Add another color?
163
+ return blue ("TL" ) // TODO(Eroui): Add another color?
161
164
}
162
165
return "Unknown"
163
166
}
@@ -196,6 +199,8 @@ func newJudgeReport() JudgeReport {
196
199
return & ConsoleJudgeReport {Stats : []CaseStatus {}}
197
200
}
198
201
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).
199
204
func timedExecution (cmd * exec.Cmd , timeOut float64 ) (int8 , time.Duration , error ) {
200
205
cmd .Start ()
201
206
start := time .Now ()
You can’t perform that action at this time.
0 commit comments