From 521ac670e36679abee32189426ddd1edaa654122 Mon Sep 17 00:00:00 2001 From: Vesal Vojdani Date: Thu, 2 Nov 2023 13:38:08 +0000 Subject: [PATCH 1/2] Add relay-sv, wrapper for analyzing a single file with RELAY --- benchexec/tools/relay-sv.py | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 benchexec/tools/relay-sv.py diff --git a/benchexec/tools/relay-sv.py b/benchexec/tools/relay-sv.py new file mode 100644 index 000000000..48d54df49 --- /dev/null +++ b/benchexec/tools/relay-sv.py @@ -0,0 +1,39 @@ +# This file is part of BenchExec, a framework for reliable benchmarking: +# https://github.com/sosy-lab/benchexec +# +# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer +# +# SPDX-License-Identifier: Apache-2.0 + +import benchexec.tools.template +import benchexec.result as result + + +class Tool(benchexec.tools.template.BaseTool2): + """ + Tool info for RELAY adapted for BenchExec. + URL: https://github.com/vesalvojdani/relay-sv + """ + + def executable(self, tool_locator): + return tool_locator.find_executable("run_relay.sh") + + def version(self, executable): + return self._version_from_tool(executable, line_prefix="Version: ") + + def name(self): + return "relay-sv" + + def cmdline(self, executable, options, task, rlimits): + return [executable, *options, *task.input_files] + + def determine_result(self, run): + status = result.RESULT_ERROR + if run.output: + if run.output.any_line_contains("Possible race"): + status = result.RESULT_UNKNOWN + elif run.output.any_line_contains("Fatal error"): + status = result.RESULT_ERROR + else: + status = result.RESULT_TRUE_PROP + return status From dd016277d629ccbea3f9d514f1fe22ea4b0e0133 Mon Sep 17 00:00:00 2001 From: Vesal Vojdani Date: Thu, 2 Nov 2023 14:42:34 +0000 Subject: [PATCH 2/2] Fix RELAY script review issues * single file * make error the default verdict --- benchexec/tools/relay-sv.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/benchexec/tools/relay-sv.py b/benchexec/tools/relay-sv.py index 48d54df49..0bdc1ffb0 100644 --- a/benchexec/tools/relay-sv.py +++ b/benchexec/tools/relay-sv.py @@ -25,15 +25,13 @@ def name(self): return "relay-sv" def cmdline(self, executable, options, task, rlimits): - return [executable, *options, *task.input_files] + return [executable, *options, task.single_input_file] def determine_result(self, run): - status = result.RESULT_ERROR if run.output: if run.output.any_line_contains("Possible race"): - status = result.RESULT_UNKNOWN - elif run.output.any_line_contains("Fatal error"): - status = result.RESULT_ERROR + return result.RESULT_UNKNOWN + elif run.output.any_line_contains("Total Warnings: 0"): + return result.RESULT_TRUE_PROP else: - status = result.RESULT_TRUE_PROP - return status + return result.RESULT_ERROR