Validate that test_fail causes a test failure
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/programs/test/metatest.c b/programs/test/metatest.c
index f03e5e7..fab3b1f 100644
--- a/programs/test/metatest.c
+++ b/programs/test/metatest.c
@@ -18,6 +18,17 @@
/****************************************************************/
+/* Test framework features */
+/****************************************************************/
+
+void meta_test_fail(const char *name)
+{
+ (void) name;
+ mbedtls_test_fail("Forced test failure", __LINE__, __FILE__);
+}
+
+
+/****************************************************************/
/* Command line entry point */
/****************************************************************/
@@ -28,6 +39,7 @@
} metatest_t;
metatest_t metatests[] = {
+ { "test_fail", "any", meta_test_fail },
{ NULL, NULL, NULL }
};