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

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