diff options
| author | Camille Mougey <commial@gmail.com> | 2016-04-06 10:02:34 +0200 |
|---|---|---|
| committer | Camille Mougey <commial@gmail.com> | 2016-04-06 10:02:34 +0200 |
| commit | cba4c6b1d0e937e2dc14682b4f3efc2d5d4fec72 (patch) | |
| tree | aaa33f85493afce3e7401efdd9dc2cc5404fc337 /test/test_all.py | |
| parent | 5db3ce6a4a1bba435fd39b9700feb7cb2256663b (diff) | |
| parent | e21cdd93c7352bc9d8f31d920b8b9596caaa7444 (diff) | |
| download | miasm-cba4c6b1d0e937e2dc14682b4f3efc2d5d4fec72.tar.gz miasm-cba4c6b1d0e937e2dc14682b4f3efc2d5d4fec72.zip | |
Merge pull request #349 from serpilliere/clean_test_output
Clean test output
Diffstat (limited to 'test/test_all.py')
| -rw-r--r-- | test/test_all.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/test/test_all.py b/test/test_all.py index 195be412..34bb0a55 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -5,7 +5,8 @@ import tempfile from utils.test import Test from utils.testset import TestSet -from utils import cosmetics, monothread, screendisplay +from utils import cosmetics, multithread +from multiprocessing import Queue testset = TestSet("../") TAGS = {"regression": "REGRESSION", # Regression tests @@ -667,16 +668,15 @@ By default, no tag is omitted." % ", ".join(TAGS.keys()), default="") "Z3 and its python binding are necessary for TranslatorZ3." if TAGS["z3"] not in exclude_tags: exclude_tags.append(TAGS["z3"]) + test_ko = [] + test_ok = [] # Set callbacks if multiproc is False: - testset.set_callback(task_done=monothread.task_done, - task_new=monothread.task_new) testset.set_cpu_numbers(1) - else: - screendisplay.init(testset.cpu_c) - testset.set_callback(task_done=screendisplay.task_done, - task_new=screendisplay.task_new) + testset.set_callback(task_done=lambda test, error:multithread.task_done(test, error, test_ok, test_ko), + task_new=multithread.task_new) + # Filter testset according to tags testset.filter_tags(exclude_tags=exclude_tags) @@ -686,6 +686,13 @@ By default, no tag is omitted." % ", ".join(TAGS.keys()), default="") # Finalize testset.end(clean=not args.do_not_clean) - + print + print (cosmetics.colors["green"] + + "Result: %d/%d pass" % (len(test_ok), len(test_ok) + len(test_ko)) + + cosmetics.colors["end"]) + for test, error in test_ko: + command_line = " ".join(test.command_line) + print cosmetics.colors["red"] + 'ERROR', cosmetics.colors["lightcyan"] + command_line + cosmetics.colors["end"] + print error # Exit with an error if at least a test failed exit(testset.tests_passed()) |