diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-04-03 13:24:59 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-05-01 14:28:36 -0700 |
commit | 6fcec59a050da7b53b2507c739c923dc47749283 (patch) | |
tree | 79a81cda250f146f49597aa031a59d2806c667c7 | |
parent | b7409883a49073e44550c7e50be25adfcfca82fe (diff) |
framework/test: Add class for cl-program-tester
These tests need some special handling for serializing, since they take
file paths as arguments.
Tested-by: Rafael Antognolli <rafael.antognolli@intel.com>
-rw-r--r-- | framework/test/piglit_test.py | 35 | ||||
-rw-r--r-- | tests/cl.py | 6 |
2 files changed, 28 insertions, 13 deletions
diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py index b5c9a53a7..f5fd0c83c 100644 --- a/framework/test/piglit_test.py +++ b/framework/test/piglit_test.py @@ -181,16 +181,6 @@ class PiglitGLTest(WindowResizeMixin, PiglitBaseTest): self._command = [n for n in new if n not in ['-auto', '-fbo']] -class PiglitCLTest(PiglitBaseTest): # pylint: disable=too-few-public-methods - """ OpenCL specific Test class. - - Set concurrency based on CL requirements. - - """ - def __init__(self, command, run_concurrent=CL_CONCURRENT, **kwargs): - super(PiglitCLTest, self).__init__(command, run_concurrent, **kwargs) - - class ASMParserTest(PiglitBaseTest): """Test class for ASM parser tests.""" @@ -208,3 +198,28 @@ class ASMParserTest(PiglitBaseTest): class BuiltInConstantsTest(PiglitBaseTest): """Test class for handling built in constants tests.""" + + +class PiglitCLTest(PiglitBaseTest): # pylint: disable=too-few-public-methods + """ OpenCL specific Test class. + + Set concurrency based on CL requirements. + + """ + def __init__(self, command, run_concurrent=CL_CONCURRENT, **kwargs): + super(PiglitCLTest, self).__init__(command, run_concurrent, **kwargs) + + +class CLProgramTester(PiglitCLTest): + + """Class for cl-program-tester tests.""" + + def __init__(self, filename): + super(CLProgramTester, self).__init__(['cl-program-tester']) + self.filename = filename + + @PiglitCLTest.command.getter + def command(self): + command = super(CLProgramTester, self).command + command.insert(1, self.filename) + return command diff --git a/tests/cl.py b/tests/cl.py index 24febe532..2ab350245 100644 --- a/tests/cl.py +++ b/tests/cl.py @@ -14,7 +14,7 @@ from __future__ import ( import os from framework.profile import TestProfile -from framework.test import PiglitCLTest +from framework.test.piglit_test import PiglitCLTest, CLProgramTester from framework import grouptools from .py_modules.constants import TESTS_DIR, GENERATED_TESTS_DIR @@ -110,8 +110,8 @@ def add_program_test_dir(group, dirpath): if ext not in ['.cl', '.program_test']: continue - profile.test_list[grouptools.join(group, testname)] = PiglitCLTest( - ['cl-program-tester', os.path.join(dirpath, filename)]) + profile.test_list[grouptools.join(group, testname)] = CLProgramTester( + os.path.join(dirpath, filename)) add_program_test_dir(grouptools.join('program', 'build'), |