On 10/29/26 10:20, Philippe Mathieu-Daudé wrote:
Replace assert() by a CHECK() macro printing one TAP line per check,
so a failure no longer aborts the remaining ones. Select the TAP
protocol in the meson setup.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
tests/tcg/mips64/octeon-insns.c | 76 +++++++++++++++++++--------------
tests/tcg/mips64/meson.build | 1 +
2 files changed, 45 insertions(+), 32 deletions(-)
diff --git a/tests/tcg/mips64/octeon-insns.c b/tests/tcg/mips64/octeon-insns.c
index 6fffc8201034..2c4fe8f58875 100644
--- a/tests/tcg/mips64/octeon-insns.c
+++ b/tests/tcg/mips64/octeon-insns.c
@@ -4,8 +4,17 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
-#include <assert.h>
#include <stdint.h>
+#include <stdio.h>
+
+static int tests, failures;
+
+#define CHECK(cond) \
+ do { \
+ int ok_ = !!(cond); \
+ printf("%s %d - %s\n", ok_ ? "ok" : "not ok", ++tests, #cond); \
+ failures += !ok_; \
+ } while (0)
...
+ printf("1..%d\n", tests);
+
+ return failures ? 1 : 0;
}
I assume you're going to use this elsewhere. Header? Macro/function
for finishing up in main?
r~