From 26cab03024c3e22786f6c0eb910077ef47dee7e0 Mon Sep 17 00:00:00 2001 From: Henrik Wachowitz Date: Wed, 14 Jan 2026 14:44:32 -0700 Subject: [PATCH 1/3] migrate to BaseTool2 --- benchexec/tools/java-ranger.py | 19 +++++++++---------- benchexec/tools/jdart.py | 21 ++++++++++----------- benchexec/tools/jpf.py | 19 +++++++++---------- 3 files changed, 28 insertions(+), 31 deletions(-) diff --git a/benchexec/tools/java-ranger.py b/benchexec/tools/java-ranger.py index e0c36a632..8f8b891b3 100644 --- a/benchexec/tools/java-ranger.py +++ b/benchexec/tools/java-ranger.py @@ -5,18 +5,17 @@ # # SPDX-License-Identifier: Apache-2.0 -import benchexec.util as util -import benchexec.tools.template import benchexec.result as result +import benchexec.tools.template -class Tool(benchexec.tools.template.BaseTool): +class Tool(benchexec.tools.template.BaseTool2): """ Tool info for Java Ranger that is based on the symbolic extension (SPF) of Java PathFinder (JPF) """ - def executable(self): - return util.find_executable("jr-sv-comp") + def executable(self, tool_locator): + return tool_locator.find_executable("jr-sv-comp") def name(self): return "Java Ranger" @@ -29,15 +28,15 @@ def version(self, executable): first_line = output.splitlines()[0] return first_line.strip() - def cmdline(self, executable, options, tasks, propertyfile, rlimits): - options = options + ["--propertyfile", propertyfile] - return [executable] + options + tasks + def cmdline(self, executable, options, task, rlimits): + options = options + ["--propertyfile", task.property_file] + return [executable] + options + list(task.input_files_or_identifier) - def determine_result(self, returncode, returnsignal, output, isTimeout): + def determine_result(self, run): # parse output status = result.RESULT_UNKNOWN - for line in output: + for line in run.output: if "UNSAFE" in line: status = result.RESULT_FALSE_PROP elif "SAFE" in line: diff --git a/benchexec/tools/jdart.py b/benchexec/tools/jdart.py index 799880269..4f07c0d51 100644 --- a/benchexec/tools/jdart.py +++ b/benchexec/tools/jdart.py @@ -5,18 +5,17 @@ # # SPDX-License-Identifier: Apache-2.0 -import benchexec.util as util -import benchexec.tools.template import benchexec.result as result +import benchexec.tools.template -class Tool(benchexec.tools.template.BaseTool): +class Tool(benchexec.tools.template.BaseTool2): """ Tool info for JDart modified by TU Dortmund """ - def executable(self): - return util.find_executable("run-jdart.sh") + def executable(self, tool_locator): + return tool_locator.find_executable("run-jdart.sh") def version(self, executable): return self._version_from_tool(executable, arg="-v") @@ -27,18 +26,18 @@ def name(self): def project_url(self): return "https://github.com/tudo-aqua/jdart" - def cmdline(self, executable, options, tasks, propertyfile, rlimits): + def cmdline(self, executable, options, task, rlimits): cmd = [executable] if options: cmd = cmd + options - if propertyfile: - cmd.append(propertyfile) - return cmd + tasks + if task.property_file: + cmd.append(task.property_file) + return cmd + list(task.input_files_or_identifier) - def determine_result(self, returncode, returnsignal, output, isTimeout): + def determine_result(self, run): # parse output status = result.RESULT_UNKNOWN - for line in output: + for line in run.output: if "== ERROR" in line: status = result.RESULT_FALSE_PROP elif "== OK" in line: diff --git a/benchexec/tools/jpf.py b/benchexec/tools/jpf.py index 8b6472b0c..3324f42bc 100644 --- a/benchexec/tools/jpf.py +++ b/benchexec/tools/jpf.py @@ -7,18 +7,17 @@ import os -import benchexec.util as util -import benchexec.tools.template import benchexec.result as result +import benchexec.tools.template -class Tool(benchexec.tools.template.BaseTool): +class Tool(benchexec.tools.template.BaseTool2): """ Tool info for JPF (plain jpf-core) """ - def executable(self): - return util.find_executable("bin/jpf-core-sv-comp") + def executable(self, tool_locator): + return tool_locator.find_executable("bin/jpf-core-sv-comp") def version(self, executable): jpf = os.path.join(os.path.dirname(executable), "jpf") @@ -32,15 +31,15 @@ def name(self): def project_url(self): return "https://github.com/javapathfinder/jpf-core/" - def cmdline(self, executable, options, tasks, propertyfile, rlimits): - options = options + ["--propertyfile", propertyfile] - return [executable] + options + tasks + def cmdline(self, executable, options, task, rlimits): + options = options + ["--propertyfile", task.property_file] + return [executable] + options + list(task.input_files_or_identifier) - def determine_result(self, returncode, returnsignal, output, isTimeout): + def determine_result(self, run): # parse output status = result.RESULT_UNKNOWN - for line in output: + for line in run.output: if "UNSAFE" in line: status = result.RESULT_FALSE_PROP elif "SAFE" in line: From 3237f147eb10179fa33cd890c8a5a58d31a81960 Mon Sep 17 00:00:00 2001 From: Henrik Wachowitz Date: Thu, 15 Jan 2026 12:10:43 -0700 Subject: [PATCH 2/3] update coastal to basetool2 --- benchexec/tools/coastal.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/benchexec/tools/coastal.py b/benchexec/tools/coastal.py index 00af8f12a..b15fe7797 100644 --- a/benchexec/tools/coastal.py +++ b/benchexec/tools/coastal.py @@ -5,20 +5,20 @@ # # SPDX-License-Identifier: Apache-2.0 -import benchexec.util as util -import benchexec.tools.template import benchexec.result as result +import benchexec.tools.template +import benchexec.util as util -class Tool(benchexec.tools.template.BaseTool): +class Tool(benchexec.tools.template.BaseTool2): """ Tool info for COASTAL """ REQUIRED_PATHS = ["coastal", "coastal-sv-comp"] - def executable(self): - return util.find_executable("coastal-sv-comp") + def executable(self, tool_locator): + return tool_locator.find_executable("coastal-sv-comp") def name(self): return "COASTAL" @@ -31,15 +31,15 @@ def version(self, executable): first_line = output.splitlines()[0] return first_line.strip() - def cmdline(self, executable, options, tasks, propertyfile, rlimits): - options = options + ["--propertyfile", propertyfile] - return [executable] + options + tasks + def cmdline(self, executable, options, task, rlimits): + options = options + ["--propertyfile", task.property_file] + return [executable] + options + list(task.input_files_or_identifier) - def determine_result(self, returncode, returnsignal, output, isTimeout): + def determine_result(self, run): # parse output status = result.RESULT_UNKNOWN - for line in output: + for line in run.output: if "UNSAFE" in line: status = result.RESULT_FALSE_PROP elif "SAFE" in line: From 374917533380739990b81853ad392e166deb05a2 Mon Sep 17 00:00:00 2001 From: Henrik Wachowitz Date: Thu, 15 Jan 2026 12:12:17 -0700 Subject: [PATCH 3/3] remove unused import --- benchexec/tools/coastal.py | 1 - 1 file changed, 1 deletion(-) diff --git a/benchexec/tools/coastal.py b/benchexec/tools/coastal.py index b15fe7797..46451374b 100644 --- a/benchexec/tools/coastal.py +++ b/benchexec/tools/coastal.py @@ -7,7 +7,6 @@ import benchexec.result as result import benchexec.tools.template -import benchexec.util as util class Tool(benchexec.tools.template.BaseTool2):