From a613ff5831a0ffedca2e829ce7833f863ff72de1 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 4 Mar 2024 14:14:33 +0100 Subject: [PATCH] sys/embunit: return failure state in TestRunner_end() --- sys/embunit/TestRunner.c | 4 +++- sys/include/embUnit/TestRunner.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/embunit/TestRunner.c b/sys/embunit/TestRunner.c index d19f8e936c..bf448e7db0 100644 --- a/sys/embunit/TestRunner.c +++ b/sys/embunit/TestRunner.c @@ -99,7 +99,7 @@ void TestRunner_runTest(Test* test) Test_run(test, &result_); } -void TestRunner_end(void) +int TestRunner_end(void) { char buf[16]; if (result_.failureCount) { @@ -118,4 +118,6 @@ void TestRunner_end(void) stdimpl_print(buf); stdimpl_print(" tests)\n"); } + + return TestRunnerHadErrors; } diff --git a/sys/include/embUnit/TestRunner.h b/sys/include/embUnit/TestRunner.h index ba8b44a107..a469154c77 100644 --- a/sys/include/embUnit/TestRunner.h +++ b/sys/include/embUnit/TestRunner.h @@ -41,7 +41,7 @@ extern "C" { void TestRunner_start(void); void TestRunner_runTest(Test* test); -void TestRunner_end(void); +int TestRunner_end(void); extern int TestRunnerHadErrors;