diff options
| author | ajax <devnull@localhost> | 2014-10-17 23:06:12 +0200 |
|---|---|---|
| committer | ajax <devnull@localhost> | 2014-10-17 23:06:12 +0200 |
| commit | 473f60bbd719911e56865f87e5be1b98e6c96448 (patch) | |
| tree | 2028a8c8b4aeac5517ab1c2e50f852780e9b239c /test/utils/monothread.py | |
| parent | 4717e8f6295c46fbfc7e27cc750df7ccf7a599be (diff) | |
| download | miasm-473f60bbd719911e56865f87e5be1b98e6c96448.tar.gz miasm-473f60bbd719911e56865f87e5be1b98e6c96448.zip | |
Test/utils: Add utils for running tests
- cosmetics: display functions - monothread: callbacks for basic test run view - screendisplay: callbacks for enhanced test run view - test: describe a Test case - testset: describe a Test set and implement methods to run it
Diffstat (limited to 'test/utils/monothread.py')
| -rw-r--r-- | test/utils/monothread.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/utils/monothread.py b/test/utils/monothread.py new file mode 100644 index 00000000..ae64f3c5 --- /dev/null +++ b/test/utils/monothread.py @@ -0,0 +1,20 @@ +import sys +import cosmetics + + +def task_done(test, error): + s = "[%s] Running tests on %s ..." % (test.base_dir.upper(), + " ".join(test.command_line)) + already_printed = len(s) + if error is not None: + cosmetics.write_colored("ERROR", "red", already_printed) + print error + else: + cosmetics.write_colored("OK", "green", already_printed) + + +def task_new(test): + s = "[%s] Running tests on %s ..." % (test.base_dir.upper(), + " ".join(test.command_line)) + sys.stdout.write(s) + sys.stdout.flush() |