diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2014-06-08 21:51:40 -0700 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2014-06-23 16:41:23 -0700 |
commit | 6cc495f456c80d1acade7ff25092b27ad005bc59 (patch) | |
tree | d0c504f7ee2746b9bd5c56c1e459da1e0542536f /framework | |
parent | aa7e228c32fcf3d162b22a08b151036ca9276d13 (diff) |
dmesg_tests.py: Use utils.nose_generator decorator
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/tests/dmesg_tests.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/framework/tests/dmesg_tests.py b/framework/tests/dmesg_tests.py index ccc314490..4e6ce7d6d 100644 --- a/framework/tests/dmesg_tests.py +++ b/framework/tests/dmesg_tests.py @@ -32,6 +32,7 @@ from framework.exectest import PiglitTest from framework.gleantest import GleanTest from framework.shader_test import ShaderTest from framework.glsl_parser_test import GLSLParserTest +import framework.tests.utils as utils def _get_dmesg(): @@ -163,6 +164,7 @@ def test_dmesg_wrap_complete(): dmesg._new_messages)) +@utils.nose_generator def test_update_result_replace(): """ Generates tests for update_result """ @@ -179,13 +181,12 @@ def test_update_result_replace(): _write_dev_kmesg() new_result = dmesg.update_result(create_test_result(res)) - # Create a yieldable and set the description for useful per-test names - yieldable = check_update_result - yieldable.description = "Test update_result: {0}".format(res) - yield yieldable, new_result['result'], res + check_update_result.description = "Test update_result: {0}".format(res) + yield check_update_result, new_result['result'], res - yieldable.description = "Test update_result subtest: {0}".format(res) - yield yieldable, new_result['subtest']['test'], res + check_update_result.description = \ + "Test update_result subtest: {0}".format(res) + yield check_update_result, new_result['subtest']['test'], res # check that the status is not updated when Dmesg.regex is set and does # not match the dmesg output @@ -193,10 +194,9 @@ def test_update_result_replace(): _write_dev_kmesg() new_result = dmesg.update_result(create_test_result(res)) - yieldable = check_equal_result - yieldable.description = ("Test update_result with non-matching regex: " - "{0}".format(res)) - yield yieldable, new_result['result'], res + check_equal_result.description = \ + "Test update_result with non-matching regex: {0}".format(res) + yield check_equal_result, new_result['result'], res # check that the status is updated when Dmesg.regex is set and matches # the dmesg output @@ -204,10 +204,10 @@ def test_update_result_replace(): _write_dev_kmesg() new_result = dmesg.update_result(create_test_result(res)) - yieldable = check_update_result - yieldable.description = ("Test update_result with matching regex: " - "{0} ".format(res)) - yield yieldable, new_result['result'], res + check_update_result.description = \ + "Test update_result with matching regex: {0} ".format(res) + yield check_update_result, new_result['result'], res + def check_equal_result(result, status): """ Tests that the result and status are equal @@ -220,6 +220,7 @@ def check_equal_result(result, status): nt.assert_equal(result, status, msg="status should not have changed " "from {} to {}".format(status, result)) + def check_update_result(result, status): """ Tests that update result replaces results correctly @@ -263,6 +264,7 @@ def test_json_serialize_updated_result(): encoded = encoder.encode(result) +@utils.nose_generator def test_testclasses_dmesg(): """ Generator that creates tests for """ lists = [(PiglitTest, ['attribs', '-auto', '-fbo'], 'PiglitTest'), @@ -272,11 +274,9 @@ def test_testclasses_dmesg(): (GLSLParserTest, 'tests/glslparsertest/shaders/main1.vert', 'GLSLParserTest')] - yieldable = check_classes_dmesg - for tclass, tfile, desc in lists: - yieldable.description = "Test dmesg in {}".format(desc) - yield yieldable, tclass, tfile + check_classes_dmesg.description = "Test dmesg in {}".format(desc) + yield check_classes_dmesg, tclass, tfile def check_classes_dmesg(test_class, test_args): |