Skip to content

Instantly share code, notes, and snippets.

@vincenthsu
Created August 26, 2013 12:32
Show Gist options
  • Save vincenthsu/6340952 to your computer and use it in GitHub Desktop.
Save vincenthsu/6340952 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import re
import sys
found_result = "false"
#parse format:
# T:49 ( 4518) P:31 I:4243600 C: 2 Min: 8 Act: 8 Avg: 8 Max: 9
parser = re.compile("(?P<T>\d+)\D+(?P<T1>\d+)\D+(?P<P>\d+)\D+(?P<I>\d+)\D+(?P<C>\d+)\D+(?P<Min>\d+)\D+(?P<Act>\d+)\D+(?P<Avg>\d+)\D+(?P<Max>\d+)")
for line in sys.stdin:
result = parser.search(line)
if result is not None:
print "test_case_id:Thread " + result.group('T') + "measurement:" + ' Cycle:' + result.group('C') + ' Min' + result.group('Min')+ ' Avg' + result.group('Avg') + ' Max' + result.group('Max') + " result:pass"
found_result = "true"
if found_result == "false":
print "test_case_id:Thread " + result.group('T') + "result:fail"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment