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