Commit 24b3fb3b authored by Maxime Perrotin's avatar Maxime Perrotin

Update test script

save test report in a file, to avoid polluting the screen
parent 57fd20fc
...@@ -49,22 +49,27 @@ def make(rule, path): ...@@ -49,22 +49,27 @@ def make(rule, path):
def summarize(results, elapsed): def summarize(results, elapsed):
''' At the end display the errors of project that failed ''' ''' At the end display the errors of project that failed '''
failed = 0 failed = 0
with open("/tmp/kazoo.err", "w") as f:
f.write("kazoo test report")
f.write("-----------------")
for errcode, stdout, stderr, path, rule in results: for errcode, stdout, stderr, path, rule in results:
if errcode == 0: if errcode == 0:
continue continue
failed += 1 failed += 1
print("=" * 80) with open("/tmp/kazoo.err", 'a') as f:
print("ERROR: %s %s" % (path, rule)) f.write("=" * 80)
if stdout: f.write("ERROR: %s %s" % (path, rule))
print("-- stdout " + "-" * 70) if stdout:
print(stdout.decode()) f.write("-- stdout " + "-" * 70)
if stderr: f.write(stdout.decode())
print("-- stderr " + "-" * 70) if stderr:
print(stderr.decode()) f.write("-- stderr " + "-" * 70)
print("-" * 80) f.write(stderr.decode())
f.write("-" * 80)
print("Finished in %.3fs" % elapsed) print("Finished in %.3fs" % elapsed)
if failed:
print("Test report in /tmp/kazoo.err")
print("%s tests, %s errors" % (len(results), failed)) print("%s tests, %s errors" % (len(results), failed))
return 0 if not failed else 1 return 0 if not failed else 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment