Blame SOURCES/0234-testsuite-expose-the-last-check-result.patch

28bab8
From 38f9a368ef56a9e85413f287e2c2e8d466bfe182 Mon Sep 17 00:00:00 2001
28bab8
From: Jakub Filak <jfilak@redhat.com>
28bab8
Date: Wed, 5 Oct 2016 09:21:52 +0200
28bab8
Subject: [PATCH] testsuite: expose the last check result
28bab8
28bab8
Get rid of the need to repeat the last check. There are certain cases
28bab8
where you don't want to perform next check if the previous one has
28bab8
failed (e.g. if a program failed to read from FD, you don't want to
28bab8
test read data).
28bab8
28bab8
Signed-off-by: Jakub Filak <jfilak@redhat.com>
28bab8
---
28bab8
 tests/helpers/testsuite.h | 5 +++++
28bab8
 1 file changed, 5 insertions(+)
28bab8
28bab8
diff --git a/tests/helpers/testsuite.h b/tests/helpers/testsuite.h
28bab8
index 809edbc6..e5c97c8f 100644
28bab8
--- a/tests/helpers/testsuite.h
28bab8
+++ b/tests/helpers/testsuite.h
28bab8
@@ -72,6 +72,9 @@ long g_testsuite_fails = 0;
28bab8
 /* Number of successful asserts. For debugging purpose. */
28bab8
 long g_testsuite_ok = 0;
28bab8
 
28bab8
+/* 1 if the last check succeeded, 0 of the last check failed */
28bab8
+int g_testsuite_last_ok = 0;
28bab8
+
28bab8
 /* Enables additional log messages. */
28bab8
 int g_testsuite_debug = 0;
28bab8
 
28bab8
@@ -111,6 +114,7 @@ FILE *g_testsuite_output_stream = 0;
28bab8
         TS_DEBUG_PRINTF("[   OK   ] %d: ", __LINE__); \
28bab8
         TS_DEBUG_PRINTF(format, __VA_ARGS__); \
28bab8
         ++g_testsuite_ok; \
28bab8
+        g_testsuite_last_ok = 1; \
28bab8
     } while (0)
28bab8
 
28bab8
 #define TS_FAILURE(format, ...) \
28bab8
@@ -118,6 +122,7 @@ FILE *g_testsuite_output_stream = 0;
28bab8
         TS_PRINTF("[ FAILED ] %d: ", __LINE__); \
28bab8
         TS_PRINTF(format, __VA_ARGS__); \
28bab8
         ++g_testsuite_fails; \
28bab8
+        g_testsuite_last_ok = 0; \
28bab8
     } while (0)
28bab8
 
28bab8
 
28bab8
-- 
28bab8
2.17.2
28bab8