[Piglit] [PATCH 1/3] framework: Add a helper class for interpreting gtest results

Dylan Baker baker.dylan.c at gmail.com
Wed Jan 15 13:49:39 PST 2014


On Wednesday, January 15, 2014 12:13:05 PM Tom Stellard wrote:
> From: Tom Stellard <thomas.stellard at amd.com>
> 
> ---
>  framework/gtest.py | 42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 framework/gtest.py
> 
> diff --git a/framework/gtest.py b/framework/gtest.py
> new file mode 100644
> index 0000000..7b474f3
> --- /dev/null
> +++ b/framework/gtest.py
> @@ -0,0 +1,42 @@
> +#!/usr/bin/env python
> +#
> +# Copyright 2013, 2014 Advanced Micro Devices, Inc.
> +#
> +# Permission is hereby granted, free of charge, to any person obtaining a
> +# copy of this software and associated documentation files (the
> "Software"), +# to deal in the Software without restriction, including
> without limitation +# the rights to use, copy, modify, merge, publish,
> distribute, sublicense, +# and/or sell copies of the Software, and to
> permit persons to whom the +# Software is furnished to do so, subject to
> the following conditions: +#
> +# The above copyright notice and this permission notice (including the next
> +# paragraph) shall be included in all copies or substantial portions of
> the +# Software.
> +#
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
> OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
> IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
> CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
> TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE.
> +#
> +# Authors: Tom Stellard <thomas.stellard at amd.com>
> +#
> +
> +import re
> +
> +from framework.exectest import ExecTest
> +
> +class GTest(ExecTest):
> +    def interpretResult(self, out, returncode, results, dmesg):
> +        # Since gtests can have several subtets, if any of the subtests
> fail +        # then we need to report fail.
> +        if len(re.findall('FAILED', out, re.MULTILINE)) > 0:
> +            results['result'] = 'fail'
> +        elif len(re.findall('PASSED', out, re.MULTILINE)) > 0:
> +            results['result'] = 'pass'
> +        else:
> +            #If we get here, then the test probably exited early.
> +            results['result'] = 'fail'
> +        return out

This looks fine to me,
reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140115/bf6715a4/attachment.pgp>


More information about the Piglit mailing list