From 79b90de5a1abdfa2584fdc5f328f40034d525011 Mon Sep 17 00:00:00 2001 From: Daniel Dietsch Date: Mon, 17 May 2021 11:02:26 +0200 Subject: [PATCH] support first-occurence regex --- benchexec/tools/smtinterpol.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/benchexec/tools/smtinterpol.py b/benchexec/tools/smtinterpol.py index 8b147f025..17eecd7b5 100644 --- a/benchexec/tools/smtinterpol.py +++ b/benchexec/tools/smtinterpol.py @@ -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): """ @@ -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