mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
31 lines
656 B
Python
Executable file
31 lines
656 B
Python
Executable file
#!/usr/bin/python
|
|
|
|
import fileinput
|
|
import json
|
|
import sys
|
|
import codecs
|
|
|
|
logfile = 'tests.log'
|
|
|
|
f = codecs.open(logfile, 'w', 'utf8')
|
|
|
|
file_events = ['begin-test', 'test-output']
|
|
|
|
sys.stdout.write("Log file : " + f.name + '\n' )
|
|
|
|
for line in fileinput.input():
|
|
obj = json.loads(line)
|
|
|
|
e = obj['event']
|
|
|
|
if e in file_events:
|
|
if e == 'begin-test':
|
|
f.write(obj['test'] )
|
|
elif e == 'test-output':
|
|
f.write(obj['output'] )
|
|
if e == 'end-test':
|
|
success = "OK\n" if obj['succeeded'] else "FAILED\n"
|
|
sys.stdout.write(obj['test'] + " -> " + success )
|
|
|
|
elif 'message' in obj and 'begin' in obj['event']:
|
|
sys.stdout.write( obj['message'] + '\n' )
|