@@ -104,6 +104,7 @@ extern void report_xfail(const char *msg_fmt, bool xfail, bool pass, ...);
extern void report_abort(const char *msg_fmt, ...);
extern void report_skip(const char *msg_fmt, ...);
extern void report_info(const char *msg_fmt, ...);
+extern void report_pass(void);
extern int report_summary(void);
bool simple_glob(const char *text, const char *pattern);
@@ -19,6 +19,13 @@ static struct spinlock lock;
#define PREFIX_DELIMITER ": "
+void report_pass(void)
+{
+ spin_lock(&lock);
+ tests++;
+ spin_unlock(&lock);
+}
+
void report_prefix_pushf(const char *prefix_fmt, ...)
{
va_list va;
@@ -726,6 +726,7 @@ do { \
dump_stack(); \
__abort_test(); \
} \
+ report_pass(); \
} while (0)
#define TEST_ASSERT_MSG(cond, fmt, args...) \
@@ -736,6 +737,7 @@ do { \
dump_stack(); \
__abort_test(); \
} \
+ report_pass(); \
} while (0)
#define __TEST_EQ(a, b, a_str, b_str, assertion, fmt, args...) \
@@ -759,6 +761,7 @@ do { \
if (assertion) \
__abort_test(); \
} \
+ report_pass(); \
} while (0)
#define TEST_ASSERT_EQ(a, b) __TEST_EQ(a, b, #a, #b, 1, "")
The assertion macros in the vmx tests only call report() if the test fails. This avoids a lot of logging (e.g. vmx_ept_access_test_reserved_bits checks 3460 assertions). However the test runner interprets passing runs as "skipped" because it looks like no testcases were run. Add a function called report_pass(), which lets tests report that a test passed without printing anything to the console. Signed-off-by: David Matlack <dmatlack@google.com> --- lib/libcflat.h | 1 + lib/report.c | 7 +++++++ x86/vmx.h | 3 +++ 3 files changed, 11 insertions(+)