Skip to content

Commit 79b90de

Browse files
committed
support first-occurence regex
1 parent d8f44dd commit 79b90de

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

benchexec/tools/smtinterpol.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# SPDX-License-Identifier: Apache-2.0
77

88
import subprocess
9-
9+
import re
1010
import benchexec.util as util
1111
import benchexec.tools.smtlib2
12-
12+
import logging
1313

1414
class Tool(benchexec.tools.smtlib2.Smtlib2Tool):
1515
"""
@@ -38,3 +38,12 @@ def name(self):
3838
def cmdline(self, executable, options, tasks, propertyfile=None, rlimits={}):
3939
assert len(tasks) <= 1, "only one inputfile supported"
4040
return [executable, "-jar", "smtinterpol.jar"] + options + tasks
41+
42+
def get_value_from_output(self, output, identifier):
43+
regex = re.compile(identifier)
44+
for line in output:
45+
match = regex.search(line)
46+
if match and len(match.groups()) > 0:
47+
return match.group(1)
48+
logging.debug("Did not find a match with regex %s", identifier)
49+
return None

0 commit comments

Comments
 (0)