|
53 | 53 | LANG_PYPY3 = "Python 3 / PyPy" |
54 | 54 | LANG_RUST = "Rust" |
55 | 55 | LANG_C_SHARP = "C# / Mono" |
| 56 | + |
56 | 57 | ALL_LANGUAGES = ( |
57 | | - LANG_CPP, LANG_CPP14, LANG_CPP17, LANG_CPP20, LANG_C, LANG_HS, LANG_JAVA, LANG_PASCAL, |
58 | | - LANG_PHP, LANG_PYTHON3, LANG_PYPY3, LANG_RUST, LANG_C_SHARP |
59 | | -) |
60 | | -NON_INTERPRETED_LANGUAGES = ( |
61 | | - LANG_C, LANG_CPP, LANG_CPP14, LANG_CPP17, LANG_CPP20, LANG_PASCAL |
62 | | -) |
63 | | -COMPILED_LANGUAGES = ( |
64 | | - LANG_C, LANG_CPP, LANG_CPP14, LANG_CPP17, LANG_CPP20, LANG_PASCAL, LANG_JAVA, |
65 | | - LANG_PYTHON3, LANG_PYPY3, LANG_HS, LANG_RUST, LANG_C_SHARP |
| 58 | + LANG_C, |
| 59 | + LANG_C_SHARP, |
| 60 | + LANG_CPP, LANG_CPP14, LANG_CPP17, LANG_CPP20, |
| 61 | + LANG_HS, |
| 62 | + LANG_JAVA, |
| 63 | + LANG_PASCAL, |
| 64 | + LANG_PHP, |
| 65 | + LANG_PYTHON3, LANG_PYPY3, |
| 66 | + LANG_RUST, |
66 | 67 | ) |
67 | 68 |
|
| 69 | +# Languages which support compilation with a manager/grader. |
| 70 | +# TODO: this should be the same as `ALL_LANGUAGES`. |
| 71 | +MANAGER_LANGUAGES = [ |
| 72 | + lang for lang in ALL_LANGUAGES if lang not in (LANG_HS, LANG_PHP, LANG_RUST) |
| 73 | +] |
| 74 | + |
| 75 | +# Languages for which solutions to be linked to a stub for communication tasks |
| 76 | +# are present under `code/`. |
| 77 | +# TODO: this should be the same as `ALL_LANGUAGES`. |
| 78 | +COMMUNICATION_LANGUAGES = [ |
| 79 | + lang for lang in MANAGER_LANGUAGES if lang not in (LANG_C_SHARP,) |
| 80 | +] |
| 81 | + |
68 | 82 | ALL_TESTS = [ |
69 | 83 |
|
70 | 84 | # Correct solutions to batch tasks. |
|
172 | 186 |
|
173 | 187 | Test('compile-fail', |
174 | 188 | task=batch_fileio, filenames=['compile-fail.%l'], |
175 | | - languages=COMPILED_LANGUAGES, |
| 189 | + # PHP's compilation step cannot fail, since it is just `cp`. |
| 190 | + languages=[lang for lang in ALL_LANGUAGES if lang != LANG_PHP], |
176 | 191 | checks=[CheckCompilationFail()]), |
177 | 192 |
|
178 | 193 | Test('compile-timeout', |
|
239 | 254 |
|
240 | 255 | Test('oom-static', |
241 | 256 | task=batch_stdio, filenames=['oom-static.%l'], |
242 | | - languages=NON_INTERPRETED_LANGUAGES, |
| 257 | + languages=(LANG_C, LANG_CPP, LANG_CPP14, |
| 258 | + LANG_CPP17, LANG_CPP20, LANG_PASCAL), |
243 | 259 | checks=[CheckOverallScore(0, 100)]), |
244 | 260 |
|
245 | 261 | Test('oom-heap', |
246 | 262 | task=batch_stdio, filenames=['oom-heap.%l'], |
247 | 263 | languages=ALL_LANGUAGES, |
248 | 264 | checks=[CheckOverallScore(0, 100)]), |
249 | 265 |
|
250 | | - # Tasks with graders. PHP is not yet supported. |
| 266 | + # Tasks with graders. |
251 | 267 |
|
252 | 268 | Test('managed-correct', |
253 | 269 | task=batch_fileio_managed, filenames=['managed-correct.%l'], |
254 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA, |
255 | | - LANG_C_SHARP), |
| 270 | + languages=MANAGER_LANGUAGES, |
256 | 271 | checks=[CheckOverallScore(100, 100)], |
257 | 272 | user_tests=True, user_managers=['grader.%l'], |
258 | 273 | user_checks=[CheckUserTestEvaluated()]), |
259 | 274 |
|
260 | 275 | Test('managed-incorrect', |
261 | 276 | task=batch_fileio_managed, filenames=['managed-incorrect.%l'], |
262 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA, |
263 | | - LANG_C_SHARP), |
| 277 | + languages=MANAGER_LANGUAGES, |
264 | 278 | checks=[CheckOverallScore(0, 100)]), |
265 | 279 |
|
266 | | - # Communication tasks. PHP is not yet supported. |
| 280 | + # Communication tasks. |
267 | 281 |
|
268 | 282 | Test('communication-fifoio-correct', |
269 | 283 | task=communication_fifoio_stubbed, |
270 | 284 | filenames=['communication-stubbed-correct.%l'], |
271 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 285 | + languages=COMMUNICATION_LANGUAGES, |
272 | 286 | checks=[CheckOverallScore(100, 100)]), |
273 | 287 |
|
274 | 288 | Test('communication-fifoio-incorrect', |
275 | 289 | task=communication_fifoio_stubbed, |
276 | 290 | filenames=['communication-stubbed-incorrect.%l'], |
277 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 291 | + languages=COMMUNICATION_LANGUAGES, |
278 | 292 | checks=[CheckOverallScore(0, 100)]), |
279 | 293 |
|
280 | 294 | Test('communication-stdio-correct', |
281 | 295 | task=communication_stdio_stubbed, |
282 | 296 | filenames=['communication-stubbed-correct.%l'], |
283 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 297 | + languages=COMMUNICATION_LANGUAGES, |
284 | 298 | checks=[CheckOverallScore(100, 100)]), |
285 | 299 |
|
286 | 300 | Test('communication-stdio-incorrect', |
287 | 301 | task=communication_stdio_stubbed, |
288 | 302 | filenames=['communication-stubbed-incorrect.%l'], |
289 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 303 | + languages=COMMUNICATION_LANGUAGES, |
290 | 304 | checks=[CheckOverallScore(0, 100)]), |
291 | 305 |
|
292 | 306 | Test('communication-stdio-unstubbed-correct', |
293 | 307 | task=communication_stdio, |
294 | 308 | filenames=['communication-stdio-correct.%l'], |
295 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 309 | + languages=COMMUNICATION_LANGUAGES, |
296 | 310 | checks=[CheckOverallScore(100, 100)]), |
297 | 311 |
|
298 | 312 | Test('communication-stdio-unstubbed-incorrect', |
299 | 313 | task=communication_stdio, |
300 | 314 | filenames=['communication-stdio-incorrect.%l'], |
301 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 315 | + languages=COMMUNICATION_LANGUAGES, |
302 | 316 | checks=[CheckOverallScore(0, 100)]), |
303 | 317 |
|
304 | 318 | # Communication tasks with two processes. |
|
307 | 321 | task=communication_many_fifoio_stubbed, |
308 | 322 | filenames=['communication-many-correct-user1.%l', |
309 | 323 | 'communication-many-correct-user2.%l'], |
310 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 324 | + languages=COMMUNICATION_LANGUAGES, |
311 | 325 | checks=[CheckOverallScore(100, 100)]), |
312 | 326 |
|
313 | 327 | Test('communication-many-fifoio-incorrect', |
314 | 328 | task=communication_many_fifoio_stubbed, |
315 | 329 | filenames=['communication-many-incorrect-user1.%l', |
316 | 330 | 'communication-many-incorrect-user2.%l'], |
317 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 331 | + languages=COMMUNICATION_LANGUAGES, |
318 | 332 | checks=[CheckOverallScore(0, 100)]), |
319 | 333 |
|
320 | 334 | Test('communication-many-stdio-correct', |
321 | 335 | task=communication_many_stdio_stubbed, |
322 | 336 | filenames=['communication-many-correct-user1.%l', |
323 | 337 | 'communication-many-correct-user2.%l'], |
324 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 338 | + languages=COMMUNICATION_LANGUAGES, |
325 | 339 | checks=[CheckOverallScore(100, 100)]), |
326 | 340 |
|
327 | 341 | Test('communication-many-stdio-incorrect', |
328 | 342 | task=communication_many_stdio_stubbed, |
329 | 343 | filenames=['communication-many-incorrect-user1.%l', |
330 | 344 | 'communication-many-incorrect-user2.%l'], |
331 | | - languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA), |
| 345 | + languages=COMMUNICATION_LANGUAGES, |
332 | 346 | checks=[CheckOverallScore(0, 100)]), |
333 | 347 |
|
334 | 348 | # TwoSteps |
|
0 commit comments