Re: [Piglit] [PATCH 1/4] util: Add utility function to accumulate results of subtests

2013-10-08 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/07/2013 09:02 AM, Eric Anholt wrote:
 Ian Romanick i...@freedesktop.org writes:
 
 From: Ian Romanick ian.d.roman...@intel.com
 
 This looks a lot like piglit_merge_result.

It sure does.  I didn't know that function existed.  Oof.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.13 (GNU/Linux)

iEYEARECAAYFAlJULuAACgkQX1gOwKyEAw9fTwCeJTj6yP8puB8OHWoU+G32sr1G
DT4An25PyGHxivKANgaxC65t+hKheYdO
=Hpdp
-END PGP SIGNATURE-
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] util: Add utility function to accumulate results of subtests

2013-10-07 Thread Eric Anholt
Ian Romanick i...@freedesktop.org writes:

 From: Ian Romanick ian.d.roman...@intel.com

This looks a lot like piglit_merge_result.


pgpcE5xiQ7TU_.pgp
Description: PGP signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] util: Add utility function to accumulate results of subtests

2013-10-07 Thread Chad Versace

On 10/07/2013 09:02 AM, Eric Anholt wrote:

Ian Romanick i...@freedesktop.org writes:


From: Ian Romanick ian.d.roman...@intel.com


This looks a lot like piglit_merge_result.


Agreed. Let's re-use piglit_merge_result().

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/4] util: Add utility function to accumulate results of subtests

2013-10-04 Thread Ian Romanick
From: Ian Romanick ian.d.roman...@intel.com

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
---
 tests/util/piglit-util.c | 25 +
 tests/util/piglit-util.h |  4 
 2 files changed, 29 insertions(+)

diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index 71d55a7..20015ce 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -206,6 +206,31 @@ piglit_report_subtest_result(enum piglit_result result, 
const char *format, ...)
va_end(ap);
 }
 
+enum piglit_result
+piglit_update_result_from_subtest_result(enum piglit_result result,
+enum piglit_result subtest_result)
+{
+   switch (subtest_result) {
+   case PIGLIT_PASS:
+   if (result == PIGLIT_SKIP)
+   result = PIGLIT_PASS;
+   break;
+   case PIGLIT_FAIL:
+   result = PIGLIT_FAIL;
+   break;
+   case PIGLIT_WARN:
+   if (result != PIGLIT_FAIL)
+   result = PIGLIT_WARN;
+   break;
+   case PIGLIT_SKIP:
+   /* Only report skip if both result and subtest_result are skip.
+*/
+   break;
+   }
+
+   return result;
+}
+
 #ifndef HAVE_STRCHRNUL
 char *strchrnul(const char *s, int c)
 {
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 52f053e..6c2fb2d 100644
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -140,6 +140,10 @@ void piglit_report_result(enum piglit_result result);
 void piglit_report_subtest_result(enum piglit_result result,
  const char *format, ...) PRINTFLIKE(2, 3);
 
+enum piglit_result
+piglit_update_result_from_subtest_result(enum piglit_result result,
+enum piglit_result subtest_result);
+
 #ifndef HAVE_STRCHRNUL
 char *strchrnul(const char *s, int c);
 #endif
-- 
1.8.1.4

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit