Skip to content
Open
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
43 changes: 43 additions & 0 deletions benchexec/tools/ltsmin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0

import benchexec.result as result
from benchexec.tools.template import BaseTool2


class Tool(BaseTool2):
"""
Wrapper for LTSmin.
"""

REQUIRED_PATHS = ["bin/", "include/", "share/"]

def executable(self, tool_locator):
return tool_locator.find_executable("ltsmin-reduce", subdir="bin")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ltsmin-reduce a meaningful default? I.e., if users specify only the tool-info module, will they expect ltsmin-reduce as default?


def name(self):
return "LTSmin"

def project_url(self):
return "https://ltsmin.utwente.nl/"

def version(self, executable):
return self._version_from_tool(executable, line_prefix="v")

def cmdline(self, executable, options, task: BaseTool2.Task, rlimits):
from pathlib import Path

real_executable = options.pop(0) if len(options) > 0 else executable
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requiring this as first option could be inconvenient if users have a larger benchmark definition and for example want to specify the tool inside some <rundefinition>. It is also somewhat hard to discover that a user has to specify the tool name as first name, and if they don't, BenchExec will try to execute an unexpected executable name like --foo (if that happens to be the first option). Should this logic be made for flexible?

real_executable = str(Path(executable).parent / real_executable)

return [real_executable] + options + [task.single_input_file]

def determine_result(self, run):
if run.exit_code.signal != 0:
return result.RESULT_ERROR

return result.RESULT_DONE
Comment on lines +39 to +43
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually redundant, as it is the default behavior. BenchExec will overwrite DONE with an error string.