Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions benchexec/tools/pono.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def name(self):
def project_url(self):
return "https://github.com/stanford-centaur/pono"

def version(self, executable):
return self._version_from_tool(executable, expected_exitcode=2)

def cmdline(self, executable, options, task, rlimits):
return [executable] + options + [task.single_input_file]

Expand All @@ -35,4 +38,6 @@ def determine_result(self, run):
return result.RESULT_TRUE_PROP
if line.startswith("sat"):
return result.RESULT_FALSE_PROP
if line.startswith("unknown"):
return result.RESULT_UNKNOWN
return result.RESULT_ERROR
4 changes: 3 additions & 1 deletion benchexec/tools/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def _version_from_tool(
use_stderr=False,
ignore_stderr=False,
line_prefix=None,
expected_exitcode=0,
Comment thread
PhilippWendler marked this conversation as resolved.
):
"""
Get version of a tool by executing it with argument "--version"
Expand All @@ -148,6 +149,7 @@ def _version_from_tool(
@param arg: an argument to pass to the tool to let it print its version
@param use_stderr: True if the tool prints version on stderr, False for stdout
@param line_prefix: if given, search line with this prefix and return only the rest of this line
@param expected_exitcode: the expected exit code after running the version-retrieval command
@return a (possibly empty) string of output of the tool
"""
try:
Expand All @@ -170,7 +172,7 @@ def _version_from_tool(
process.stderr,
)
return ""
if process.returncode:
if process.returncode != expected_exitcode:
logging.warning(
"Cannot determine %s version, exit code %s",
executable,
Expand Down