Ext
 All Files Functions
valgrind_parser.py
1 from collections import deque
2 import sys
3 
4 with open("log.txt") as file:
5  [last_line] = deque(file, maxlen=1) or ['']
6  errors = last_line.split('ERROR SUMMARY: ')[1]
7  errors_count = int(errors.split(' errors')[0])
8  if errors_count:
9  sys.stderr.write("Errors founded by valgrind: {0}\n".format(errors_count))
10  sys.exit(1)
11  else:
12  "All good in valgrind log"