diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2011-02-12 12:07:08 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@intel.com> | 2011-02-17 08:08:42 -0800 |
commit | 209f3d642a2825f103e2147d7ef356806d1255a5 (patch) | |
tree | d9973f69e971295f80fef17d1dd11cb8aa30746f /framework | |
parent | bc66671c2860145092a70eb9fec0d3114d8edfaf (diff) |
Replace poolName in Test constructor with boolean option.
Replaced poolName in the Test constructor with runConcurrent
boolean option. runConcurrent defaults to False. When True, the
Test pushes its doRunWork to the ConcurrentTestPool to be executed
in another thread. When False, doRunWork is executed immediately
on the calling thread (main thread).
Reviewed-by: Chad Versace <chad.versace@intel.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/core.py | 15 | ||||
-rwxr-xr-x | framework/glsl_parser_test.py | 6 |
2 files changed, 13 insertions, 8 deletions
diff --git a/framework/core.py b/framework/core.py index 8f33b913..58b62927 100644 --- a/framework/core.py +++ b/framework/core.py @@ -290,17 +290,22 @@ class Test: ignoreErrors = [] sleep = 0 - def __init__(self, poolName = "base"): - self.poolName = poolName + def __init__(self, runConcurrent = False): + ''' + 'runConcurrent' controls whether this test will + execute it's work (i.e. __doRunWork) on the calling thread + (i.e. the main thread) or from the ConcurrentTestPool threads. + ''' + self.runConcurrent = runConcurrent def run(self): raise NotImplementedError def doRun(self, env, path): - if "base" == self.poolName: - self.__doRunWork(env, path) - else: + if self.runConcurrent: ConcurrentTestPool().put(self.__doRunWork, args = (env, path,)) + else: + self.__doRunWork(env, path) def __doRunWork(self, env, path): # Exclude tests that don't match the filter regexp diff --git a/framework/glsl_parser_test.py b/framework/glsl_parser_test.py index 3ecdf4cb..03511254 100755 --- a/framework/glsl_parser_test.py +++ b/framework/glsl_parser_test.py @@ -185,11 +185,11 @@ class GLSLParserTest(PlainExecTest): 'require_extensions' : '', } - def __init__(self, filepath, poolName='gpu-not-used'): + def __init__(self, filepath, runConcurrent = True): """ :filepath: Must end in one '.vert', '.geom', or '.frag'. """ - Test.__init__(self, poolName) + Test.__init__(self, runConcurrent) self.__config = None self.__command = None self.__filepath = filepath @@ -305,7 +305,7 @@ class GLSLParserTest(PlainExecTest): Check that that all required options are present. If validation fails, set ``self.result`` to failure. - + Currently, this function does not validate the options' values. |