Skip to content

Commit

Permalink
Use a custom version-extraction script for BtorMC
Browse files Browse the repository at this point in the history
`btormc --version` requires receiving EOF to terminate.
Version: https://github.com/Boolector/boolector/tree/6603ed7b8d401f9bf387f32c702e3e938c50924d
See also: Boolector/boolector#225
  • Loading branch information
Po-Chun-Chien committed Jun 6, 2024
1 parent 5ecae63 commit 6e2da54
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion benchexec/tools/btormc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#
# SPDX-License-Identifier: Apache-2.0

import logging
import subprocess

import benchexec.result as result
import benchexec.tools.template

Expand All @@ -24,7 +27,19 @@ def project_url(self):
return "https://github.com/Boolector/boolector"

def version(self, executable):
return self._version_from_tool(executable, stdin="")
try:
process = subprocess.run(
[executable, "--version"],
stdout=subprocess.PIPE,
universal_newlines=True,
input="",
)
except OSError as e:
logging.warning(
"Cannot run %s to determine version: %s", executable, e.strerror
)
return ""
return process.stdout.strip()

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

0 comments on commit 6e2da54

Please sign in to comment.