Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test more language variants in communication #1280

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 41 additions & 27 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, since it is just `cp`.
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,
veluca93 marked this conversation as resolved.
Show resolved Hide resolved
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.
# Communication tasks.

Test('communication-fifoio-correct',
task=communication_fifoio_stubbed,
filenames=['communication-stubbed-correct.%l'],
languages=(LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON3, LANG_JAVA),
veluca93 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading