[Piglit] [PATCH v2] framework: add support for a "timeout" status
Dylan Baker
baker.dylan.c at gmail.com
Mon Mar 31 09:56:18 PDT 2014
On Monday, March 31, 2014 10:57:21 Thomas Wood wrote:
> v2: use NoChangeStatus for the timeout class
>
> Signed-off-by: Thomas Wood <thomas.wood at intel.com>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
> framework/log.py | 2 +-
> framework/status.py | 9 ++++++---
> framework/tests/status_tests.py | 6 +++---
> templates/index.css | 5 ++++-
> 4 files changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/framework/log.py b/framework/log.py
> index 2835f1e..cdc3e94 100644
> --- a/framework/log.py
> +++ b/framework/log.py
> @@ -39,7 +39,7 @@ class Log(object):
> self.__generator = (x for x in xrange(self.__total))
> self.__pad = len(str(self.__total))
> self.__summary_keys = set(['pass', 'fail', 'warn', 'crash', 'skip',
> - 'dmesg-warn', 'dmesg-fail', 'dry-run'])
> + 'dmesg-warn', 'dmesg-fail', 'dry-run', 'timeout'])
is this line over 80 characters? If it is you should wrap timeout to a new line.
> self.__summary = collections.defaultdict(lambda: 0)
>
> self.__output = "[{percent}] {summary} {running}\r"
> diff --git a/framework/status.py b/framework/status.py
> index bb7c594..a73caad 100644
> --- a/framework/status.py
> +++ b/framework/status.py
> @@ -41,7 +41,6 @@ warn
> dmesg-fail
> fail
> crash
> -timeout
>
> SKIP and NOTRUN are not factored into regressions and fixes, they are
> counted seperately. They also derive from a sublcass of Status, which
> always returns @@ -62,7 +61,8 @@ __all__ = ['NOTRUN',
> 'CRASH',
> 'DMESG_WARN',
> 'DMESG_FAIL',
> - 'SKIP']
> + 'SKIP',
> + 'TIMEOUT']
>
> def status_lookup(status):
> """ Provided a string return a status object instance
> @@ -79,7 +79,8 @@ def status_lookup(status):
> 'crash': CRASH,
> 'dmesg-warn': DMESG_WARN,
> 'dmesg-fail': DMESG_FAIL,
> - 'notrun': NOTRUN}
> + 'notrun': NOTRUN,
> + 'timeout': TIMEOUT}
>
> try:
> return status_dict[status]
> @@ -220,6 +221,8 @@ class NoChangeStatus(Status):
>
> NOTRUN = NoChangeStatus('Not Run')
>
> +TIMEOUT = NoChangeStatus('timeout')
> +
> SKIP = NoChangeStatus('skip')
>
> PASS = Status('pass', 0, (1, 1))
> diff --git a/framework/tests/status_tests.py
> b/framework/tests/status_tests.py index ad0630a..087e28a 100644
> --- a/framework/tests/status_tests.py
> +++ b/framework/tests/status_tests.py
> @@ -69,7 +69,7 @@ def test_gen_lookup():
> """ Generator that attempts to do a lookup on all statuses """
> yieldable = check_lookup
>
> - for stat in STATUSES + ['skip', 'notrun']:
> + for stat in STATUSES + ['skip', 'notrun', 'timeout']:
> yieldable.description = "Lookup: {}".format(stat)
> yield yieldable, stat
>
> @@ -144,10 +144,10 @@ def check_not_change(new, old):
>
>
> def test_not_change():
> - """ Skip and NotRun should not count as changes """
> + """ Skip, NotRun and Timeout should not count as changes """
> yieldable = check_not_change
>
> - for nochange, stat in itertools.product(['skip', 'notrun'], STATUSES):
> + for nochange, stat in itertools.product(['skip', 'notrun', 'timeout'],
> STATUSES): yieldable.description = "{0} -> {1} should not be a
> change".format( nochange, stat)
> yield yieldable, status.status_lookup(nochange),
> status.status_lookup(stat) diff --git a/templates/index.css
> b/templates/index.css
> index 577370c..3389738 100644
> --- a/templates/index.css
> +++ b/templates/index.css
> @@ -36,7 +36,7 @@ td:first-child > div {
> background-color: #c8c838
> }
>
> -td.skip, td.warn, td.fail, td.pass, td.trap, td.abort, td.crash,
> td.dmesg-warn, td.dmesg-fail { +td.skip, td.warn, td.fail, td.pass,
> td.trap, td.abort, td.crash, td.dmesg-warn, td.dmesg-fail, td.timeout {
> text-align: right;
> }
>
> @@ -67,6 +67,9 @@ tr:nth-child(even) td.fail { background-color: #e00505; }
> tr:nth-child(odd) td.dmesg-fail { background-color: #ff2020; }
> tr:nth-child(even) td.dmesg-fail { background-color: #e00505; }
>
> +tr:nth-child(odd) td.timeout { background-color: #83bdf6; }
> +tr:nth-child(even) td.timeout { background-color: #4a9ef2; }
> +
> tr:nth-child(odd) td.trap { background-color: #111111; }
> tr:nth-child(even) td.trap { background-color: #000000; }
> tr:nth-child(odd) td.abort { background-color: #111111; }
I haven't tested this series but it looks fine other than the one question I had. With that addressed way:
Acked-by: Dylan Baker <baker.dylan.c at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140331/232ab6a6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140331/232ab6a6/attachment-0001.sig>
More information about the Piglit
mailing list