From 8d0778040c949e02644701c8563a09e28cb5568f Mon Sep 17 00:00:00 2001 From: Marian Lingsch-Rosenfeld Date: Tue, 19 Nov 2024 16:53:23 +0100 Subject: [PATCH 1/2] Add support for task definitions in format version 2.1 See: https://gitlab.com/sosy-lab/benchmarking/task-definition-format/-/merge_requests/3 --- benchexec/model.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/benchexec/model.py b/benchexec/model.py index 39012fd11..23d1c445d 100644 --- a/benchexec/model.py +++ b/benchexec/model.py @@ -44,7 +44,7 @@ _EXPECTED_RESULT_FILTER_VALUES = {True: "true", False: "false", None: "unknown"} _WARNED_ABOUT_UNSUPPORTED_EXPECTED_RESULT_FILTER = False -_TASK_DEF_VERSIONS = frozenset(["0.1", "1.0", "2.0"]) +_TASK_DEF_VERSIONS = frozenset(["0.1", "1.0", "2.0", "2.1"]) def substitute_vars(oldList, runSet=None, task_file=None): @@ -107,12 +107,25 @@ def load_task_definition_file(task_def_file): f"invalid format_version '{task_def.get('format_version')}'." ) - if format_version != "2.0" and "options" in task_def: + if format_version not in ["2.0", "2.1"] and "options" in task_def: raise BenchExecException( f"Task-definition file {task_def_file} specifies invalid key 'options', " f"format_version needs to be at least 2.0 for this." ) + if format_version != "2.1" and "additional_information" in task_def: + raise BenchExecException( + f"Task-definition file {task_def_file} specifies invalid key 'additional_information', " + f"format_version needs to be at least 2.1 for this." + ) + + if format_version == "2.1": + # Remove the additional_information key from the task definition + # since this should only be considered as a comment + # as described in its definition: + # https://gitlab.com/sosy-lab/benchmarking/task-definition-format + task_def.pop("additional_information", None) + return task_def From 48ebb8b715f27d62adc8793f7e03fa451851b241 Mon Sep 17 00:00:00 2001 From: marian-lingsch <72811099+marian-lingsch@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:41:39 +0100 Subject: [PATCH 2/2] Do not delete the additional_information key from the task information This is not required cf. https://github.com/sosy-lab/benchexec/pull/1114#discussion_r1848663052 Co-authored-by: Philipp Wendler <2545335+PhilippWendler@users.noreply.github.com> --- benchexec/model.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/benchexec/model.py b/benchexec/model.py index 23d1c445d..29013de3b 100644 --- a/benchexec/model.py +++ b/benchexec/model.py @@ -119,13 +119,6 @@ def load_task_definition_file(task_def_file): f"format_version needs to be at least 2.1 for this." ) - if format_version == "2.1": - # Remove the additional_information key from the task definition - # since this should only be considered as a comment - # as described in its definition: - # https://gitlab.com/sosy-lab/benchmarking/task-definition-format - task_def.pop("additional_information", None) - return task_def