about summary refs log tree commit diff stats
path: root/test/utils/multithread.py
diff options
context:
space:
mode:
authorserpilliere <fabrice.desclaux@cea.fr>2016-03-13 22:30:29 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2016-04-06 09:22:41 +0200
commited08c49564309ff7e0aa9a587d4359a8f6d9ce2d (patch)
tree0f11748391a3c85e3efdd82f26e3efa2f34d41e6 /test/utils/multithread.py
parent5db3ce6a4a1bba435fd39b9700feb7cb2256663b (diff)
downloadmiasm-ed08c49564309ff7e0aa9a587d4359a8f6d9ce2d.tar.gz
miasm-ed08c49564309ff7e0aa9a587d4359a8f6d9ce2d.zip
Test: simple output
Diffstat (limited to 'test/utils/multithread.py')
-rw-r--r--test/utils/multithread.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/utils/multithread.py b/test/utils/multithread.py
new file mode 100644
index 00000000..287b5ebd
--- /dev/null
+++ b/test/utils/multithread.py
@@ -0,0 +1,24 @@
+import sys
+import cosmetics
+import time
+
+
+def task_done(test, error, test_ok, test_ko):
+    command_line = " ".join(test.command_line)
+    if error is not None:
+        print cosmetics.colors["red"] + 'ERROR',
+        print cosmetics.colors["lightcyan"] + command_line + cosmetics.colors["end"]
+        print error
+        test_ko.append((test, error))
+    else:
+        print cosmetics.colors["green"] + 'DONE',
+        print cosmetics.colors["lightcyan"] + command_line + cosmetics.colors["end"],
+        print "%ds" % (time.time() - test.start_time)
+        test_ok.append((test, error))
+
+
+def task_new(test):
+    command_line = " ".join(test.command_line)
+    print cosmetics.colors["lightcyan"],
+    print test.base_dir.upper(), command_line,
+    print cosmetics.colors["end"]