|
17 | 17 | /* |
18 | 18 | * This program compiles incoming source files and puts the resulting |
19 | 19 | * executables into the spool directory. |
20 | | - * |
21 | | - * Note: this program must compile and work on win32 |
22 | 20 | */ |
23 | 21 |
|
24 | 22 | #include "ejudge/config.h" |
@@ -185,8 +183,14 @@ invoke_style_checker( |
185 | 183 | if (!r) { |
186 | 184 | retval = RUN_OK; |
187 | 185 | } else { |
188 | | - retval = RUN_STYLE_ERR; |
189 | | - fprintf(log_f, "\nStyle checker detected errors\n"); |
| 186 | + if (req->not_ok_is_cf > 0) { |
| 187 | + retval = RUN_CHECK_FAILED; |
| 188 | + fprintf(log_f, "\nStyle checker detected errors\n"); |
| 189 | + fprintf(log_f, "Check failed on non-OK result mode enabled\n"); |
| 190 | + } else { |
| 191 | + retval = RUN_STYLE_ERR; |
| 192 | + fprintf(log_f, "\nStyle checker detected errors\n"); |
| 193 | + } |
190 | 194 | } |
191 | 195 |
|
192 | 196 | cleanup: |
@@ -303,13 +307,25 @@ invoke_compiler( |
303 | 307 |
|
304 | 308 | if (task_IsTimeout(tsk)) { |
305 | 309 | err("Compilation process timed out"); |
306 | | - fprintf(log_f, "\nCompilation process timed out\n"); |
307 | 310 | task_Delete(tsk); |
308 | | - return RUN_COMPILE_ERR; |
| 311 | + if (req->not_ok_is_cf > 0) { |
| 312 | + fprintf(log_f, "\nCompilation process timed out\n"); |
| 313 | + fprintf(log_f, "Check failed on non-OK result mode enabled\n"); |
| 314 | + return RUN_CHECK_FAILED; |
| 315 | + } else { |
| 316 | + fprintf(log_f, "\nCompilation process timed out\n"); |
| 317 | + return RUN_COMPILE_ERR; |
| 318 | + } |
309 | 319 | } else if (task_IsAbnormal(tsk)) { |
310 | 320 | info("Compilation failed"); |
311 | 321 | task_Delete(tsk); |
312 | | - return RUN_COMPILE_ERR; |
| 322 | + if (req->not_ok_is_cf > 0) { |
| 323 | + fprintf(log_f, "\nCompilation failed\n"); |
| 324 | + fprintf(log_f, "Check failed on non-OK result mode enabled\n"); |
| 325 | + return RUN_CHECK_FAILED; |
| 326 | + } else { |
| 327 | + return RUN_COMPILE_ERR; |
| 328 | + } |
313 | 329 | } else { |
314 | 330 | info("Compilation sucessful"); |
315 | 331 | task_Delete(tsk); |
|
0 commit comments