diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2012-12-06 14:14:48 -0800 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2013-01-02 19:52:25 -0500 |
commit | 208ff166a643a9da26bae9f138ecda16a726e087 (patch) | |
tree | ed72b6c47a870e13aed0dc4a1ebac789b4be1719 /framework/core.py | |
parent | 8f06c3be5dc4d4f963e50da3fa540706ef5e9bef (diff) |
piglt: Add support for subtests v2
Subtests allow a test to produce more than one result. This is useful
for tests where it may be convenient to combine several somewhat
unrelated tests into a single program. For example, a cl test like:
kernel void test(TYPE *out, TYPE *in) {
out[0] = some_builtin_function(in[0], in[1]);
}
That uses only one kernel, but recompiles it several times with different
definitions of the macro 'TYPE' in order to test the builtin with all
the possible types.
To take advantage of the subtest feature, programs should output one
PIGLIT line per subtest as in the following example:
PIGLIT:subtest {'testA' : 'pass'}
PIGLIT:subtest {'testB' : 'fail'}
Where testA and testB are the name of the subtests.
In the result summary, this will be displayed as:
TestName 1/2
testA pass
testB fail
v2:
- Print one line for each subtest rather than printing them all
together.
Acked-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'framework/core.py')
-rw-r--r-- | framework/core.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/framework/core.py b/framework/core.py index 73a238d0..0a8237de 100644 --- a/framework/core.py +++ b/framework/core.py @@ -460,7 +460,12 @@ class Test: status(result['result']) - json_writer.write_dict_item(path, result) + if 'subtest' in result and len(result['subtest'].keys()) > 1: + for test in result['subtest'].keys(): + result['result'] = result['subtest'][test] + json_writer.write_dict_item(path + '/' + test, result) + else: + json_writer.write_dict_item(path, result) else: status("dry-run") |