Skip to content

Commit

Permalink
support first-occurence regex
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldietsch committed Oct 27, 2024
1 parent d8f44dd commit 79b90de
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions benchexec/tools/smtinterpol.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# SPDX-License-Identifier: Apache-2.0

import subprocess

import re
import benchexec.util as util
import benchexec.tools.smtlib2

import logging

class Tool(benchexec.tools.smtlib2.Smtlib2Tool):
"""
Expand Down Expand Up @@ -38,3 +38,12 @@ def name(self):
def cmdline(self, executable, options, tasks, propertyfile=None, rlimits={}):
assert len(tasks) <= 1, "only one inputfile supported"
return [executable, "-jar", "smtinterpol.jar"] + options + tasks

def get_value_from_output(self, output, identifier):
regex = re.compile(identifier)
for line in output:
match = regex.search(line)
if match and len(match.groups()) > 0:
return match.group(1)
logging.debug("Did not find a match with regex %s", identifier)
return None

0 comments on commit 79b90de

Please sign in to comment.