diff options
author | Thomas Wood <thomas.wood@intel.com> | 2015-03-26 15:18:57 +0000 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2015-03-26 17:37:07 +0000 |
commit | 67749beff09eb83ced8fb062db8a5724b371be1b (patch) | |
tree | 3e77e31d50653256fbd9a69e6f6679d7960ea0bc | |
parent | a04c0af968922b694221899d6da5f5a752a304f8 (diff) |
profile.py: pass options to the pre-run and post-run hooks
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
-rw-r--r-- | framework/profile.py | 12 | ||||
-rw-r--r-- | tests/igt.py | 2 | ||||
-rw-r--r-- | tests/xts.py | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/framework/profile.py b/framework/profile.py index 603e87285..1384bbdfe 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -168,21 +168,25 @@ class TestProfile(object): file=sys.stderr) sys.exit(1) - def _pre_run_hook(self): + def _pre_run_hook(self, opts): """ Hook executed at the start of TestProfile.run To make use of this hook one will need to subclass TestProfile, and set this to do something, as be default it will no-op + Arguments: + opts -- a core.Options instance """ pass - def _post_run_hook(self): + def _post_run_hook(self, opts): """ Hook executed at the end of TestProfile.run To make use of this hook one will need to subclass TestProfile, and set this to do something, as be default it will no-op + Arguments: + opts -- a core.Options instance """ pass @@ -205,7 +209,7 @@ class TestProfile(object): """ - self._pre_run_hook() + self._pre_run_hook(opts) Test.OPTS = opts chunksize = 1 @@ -250,7 +254,7 @@ class TestProfile(object): log.get().summary() - self._post_run_hook() + self._post_run_hook(opts) def filter_tests(self, function): """Filter out tests that return false from the supplied function diff --git a/tests/igt.py b/tests/igt.py index 1bc7f2303..8c7963baf 100644 --- a/tests/igt.py +++ b/tests/igt.py @@ -91,7 +91,7 @@ else: class IGTTestProfile(TestProfile): """Test profile for intel-gpu-tools tests.""" - def _pre_run_hook(self): + def _pre_run_hook(self, opts): if not check_environment(): sys.exit(1) diff --git a/tests/xts.py b/tests/xts.py index 0e277dc3d..3ac931da9 100644 --- a/tests/xts.py +++ b/tests/xts.py @@ -41,7 +41,7 @@ X_TEST_SUITE = framework.core.PIGLIT_CONFIG.get('xts', 'path') class XTSProfile(TestProfile): # pylint: disable=too-few-public-methods """ A subclass of TestProfile that provides a setup hook for XTS """ - def _pre_run_hook(self): + def _pre_run_hook(self, opts): """ This hook sets the XTSTest.results_path variable Setting this variable allows images created by XTS to moved into the |