summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-07-04 08:14:24 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-07-04 08:14:24 +0200
commitf09f3ae99d3699c652026f310b807e979896a3a0 (patch)
tree2b2174ab8af9b00a060e9a633b207cad62c3e643
parent1a36bcc5948355165a1453813a840103deffe8b6 (diff)
downloadxdd2esi-f09f3ae99d3699c652026f310b807e979896a3a0.tar.gz
xdd2esi-f09f3ae99d3699c652026f310b807e979896a3a0.zip
Remove double warnings and change output format
-rw-r--r--test.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/test.py b/test.py
index 0fa742d..efaefa2 100644
--- a/test.py
+++ b/test.py
@@ -13,6 +13,7 @@ import argparse
import os
import warnings
import logging
+import collections
warncount = 0
@@ -73,8 +74,16 @@ def main():
if failpass != "PASS" or warncnt != '':
print()
print('{:40.40} {}{}'.format(xdd, failpass, warncnt))
+ w_msgs = []
for warning in w:
- print(" {}: {}".format(warning.category.__name__, warning.message))
+ w_msgs.append((str(warning.category.__name__), str(warning.message)))
+ for warning in collections.Counter(w_msgs).items():
+ count = warning[1]
+ if count == 1:
+ countstr = "{} time".format(count)
+ else:
+ countstr = "{} times".format(count)
+ print(" {:8} {:30} {}".format(countstr, warning[0][0], warning[0][1]))
if exception is not None:
print(" {}".format(exception))
if failpass != "PASS" or warncnt != '':