Skip to content

Commit

Permalink
Test more language variants in communication
Browse files Browse the repository at this point in the history
  • Loading branch information
veluca93 committed Nov 17, 2024
1 parent 39d272b commit a353952
Showing 1 changed file with 40 additions and 26 deletions.
66 changes: 40 additions & 26 deletions cmstestsuite/Tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,32 @@
LANG_PYPY3 = "Python 3 / PyPy"
LANG_RUST = "Rust"
LANG_C_SHARP = "C# / Mono"

ALL_LANGUAGES = (
LANG_CPP, LANG_CPP14, LANG_CPP17, LANG_CPP20, LANG_C, LANG_HS, LANG_JAVA, LANG_PASCAL,
LANG_PHP, LANG_PYTHON3, LANG_PYPY3, LANG_RUST, LANG_C_SHARP
)
NON_INTERPRETED_LANGUAGES = (
LANG_C, LANG_CPP, LANG_CPP14, LANG_CPP17, LANG_CPP20, LANG_PASCAL
)
COMPILED_LANGUAGES = (
LANG_C, LANG_CPP, LANG_CPP14, LANG_CPP17, LANG_CPP20, LANG_PASCAL, LANG_JAVA,
LANG_PYTHON3, LANG_PYPY3, LANG_HS, LANG_RUST, LANG_C_SHARP
LANG_C,
LANG_C_SHARP,
LANG_CPP, LANG_CPP14, LANG_CPP17, LANG_CPP20,
LANG_HS,
LANG_JAVA,
LANG_PASCAL,
LANG_PHP,
LANG_PYTHON3, LANG_PYPY3,
LANG_RUST,
)

# Languages which support compilation with a manager/grader.
# TODO: this should be the same as `ALL_LANGUAGES`.
MANAGER_LANGUAGES = [
lang for lang in ALL_LANGUAGES if lang not in (LANG_HS, LANG_PHP, LANG_RUST)
]

# Languages for which solutions to be linked to a stub for communication tasks
# are present under `code/`.
# TODO: this should be the same as `ALL_LANGUAGES`.
COMMUNICATION_LANGUAGES = [
lang for lang in MANAGER_LANGUAGES if lang not in (LANG_C_SHARP,)
]

ALL_TESTS = [

# Correct solutions to batch tasks.
Expand Down Expand Up @@ -172,7 +186,8 @@

Test('compile-fail',
task=batch_fileio, filenames=['compile-fail.%l'],
languages=COMPILED_LANGUAGES,
# PHP's compilation step cannot fail.
languages=[lang for lang in ALL_LANGUAGES if lang != LANG_PHP],
checks=[CheckCompilationFail()]),

Test('compile-timeout',
Expand Down Expand Up @@ -239,66 +254,65 @@

Test('oom-static',
task=batch_stdio, filenames=['oom-static.%l'],
languages=NON_INTERPRETED_LANGUAGES,
languages=(LANG_C, LANG_CPP, LANG_CPP14,
LANG_CPP17, LANG_CPP20, LANG_PASCAL),
checks=[CheckOverallScore(0, 100)]),

Test('oom-heap',
task=batch_stdio, filenames=['oom-heap.%l'],
languages=ALL_LANGUAGES,
checks=[CheckOverallScore(0, 100)]),

# Tasks with graders. PHP is not yet supported.
# Tasks with graders.

Test('managed-correct',
task=batch_fileio_managed, filenames=['managed-correct.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA,
LANG_C_SHARP),
languages=MANAGER_LANGUAGES,
checks=[CheckOverallScore(100, 100)],
user_tests=True, user_managers=['grader.%l'],
user_checks=[CheckUserTestEvaluated()]),

Test('managed-incorrect',
task=batch_fileio_managed, filenames=['managed-incorrect.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA,
LANG_C_SHARP),
languages=MANAGER_LANGUAGES,
checks=[CheckOverallScore(0, 100)]),

# Communication tasks. PHP is not yet supported.

Test('communication-fifoio-correct',
task=communication_fifoio_stubbed,
filenames=['communication-stubbed-correct.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(100, 100)]),

Test('communication-fifoio-incorrect',
task=communication_fifoio_stubbed,
filenames=['communication-stubbed-incorrect.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(0, 100)]),

Test('communication-stdio-correct',
task=communication_stdio_stubbed,
filenames=['communication-stubbed-correct.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(100, 100)]),

Test('communication-stdio-incorrect',
task=communication_stdio_stubbed,
filenames=['communication-stubbed-incorrect.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(0, 100)]),

Test('communication-stdio-unstubbed-correct',
task=communication_stdio,
filenames=['communication-stdio-correct.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(100, 100)]),

Test('communication-stdio-unstubbed-incorrect',
task=communication_stdio,
filenames=['communication-stdio-incorrect.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(0, 100)]),

# Communication tasks with two processes.
Expand All @@ -307,28 +321,28 @@
task=communication_many_fifoio_stubbed,
filenames=['communication-many-correct-user1.%l',
'communication-many-correct-user2.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(100, 100)]),

Test('communication-many-fifoio-incorrect',
task=communication_many_fifoio_stubbed,
filenames=['communication-many-incorrect-user1.%l',
'communication-many-incorrect-user2.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(0, 100)]),

Test('communication-many-stdio-correct',
task=communication_many_stdio_stubbed,
filenames=['communication-many-correct-user1.%l',
'communication-many-correct-user2.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(100, 100)]),

Test('communication-many-stdio-incorrect',
task=communication_many_stdio_stubbed,
filenames=['communication-many-incorrect-user1.%l',
'communication-many-incorrect-user2.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
languages=COMMUNICATION_LANGUAGES,
checks=[CheckOverallScore(0, 100)]),

# TwoSteps
Expand Down

0 comments on commit a353952

Please sign in to comment.