Skip to content

Commit

Permalink
refactor get_value_from_output
Browse files Browse the repository at this point in the history
  • Loading branch information
ricffb committed Oct 16, 2024
1 parent 50322cc commit f7bf010
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions benchexec/tools/nacpa.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,14 @@ def determine_result(self, run):
return result.RESULT_UNKNOWN

def get_value_from_output(self, output, identifier):
# search for the text in output and get its value,
# search the first line, that starts with the searched text
# warn if there are more lines (multiple statistics from sequential analysis?)
match = None
for line in output:
if line.lstrip().startswith(identifier):
startPosition = line.find(":") + 1
endPosition = line.find("(", startPosition)

if endPosition == -1:
endPosition = len(line)
if match is None:
match = line[startPosition:endPosition].strip()
break

return match
return line[startPosition:endPosition].strip()

return None

0 comments on commit f7bf010

Please sign in to comment.