[Piglit] [Patch v2 2/4] framework/core.py: Add pre_run and post_run hooks to TestProfile

Eric Anholt eric at anholt.net
Tue Apr 22 16:00:09 PDT 2014


Dylan Baker <baker.dylan.c at gmail.com> writes:

> These hooks no-op in the default TestProfile class, however they are
> intended to give versatility and power to external test suites, which
> may have specific environment requirements, setup requirements, or
> teardown requirements, by allowing them to subclass TestProfile and set
> these methods.
> ---
>  framework/core.py | 24 +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/framework/core.py b/framework/core.py
> index 5238f60..48dd9b0 100644
> --- a/framework/core.py
> +++ b/framework/core.py
> @@ -474,14 +474,34 @@ class TestProfile(object):
>          self.test_list = dict(item for item in self.test_list.iteritems()
>                                if check_all(item))
>  
> +    def pre_run_hook(self):
> +        """ 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 dfault it will no-op
> +
> +        """
> +        pass
> +
> +    def post_run_hook(self):
> +        """ 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 dfault it will no-op

"by default" (both times)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140422/4fcb83d6/attachment.sig>


More information about the Piglit mailing list