about summary refs log tree commit diff stats
path: root/test/utils/multithread.py
blob: d0874dd167d4052f9b566bd6bb7f4d147d52450f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from __future__ import print_function
import sys
from . 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', end=' ')
        print(cosmetics.colors["lightcyan"] + command_line + cosmetics.colors["end"])
        print(error)
        test_ko.append((test, error))
    else:
        print(cosmetics.colors["green"] + 'DONE', end=' ')
        print(cosmetics.colors["lightcyan"] + command_line + cosmetics.colors["end"], 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"], end=' ')
    print(test.base_dir.upper(), command_line, end=' ')
    print(cosmetics.colors["end"])