Skip to content
Snippets Groups Projects
Commit 5e6bf869 authored by René Kijewski's avatar René Kijewski
Browse files

unittests: exit(1) or error

parent 61152df4
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,7 @@
static TestResult result_;
static Test* root_;
int TestRunnerHadErrors;
static void TestRunner_startTest(TestListner* self,Test* test)
{
......@@ -73,6 +74,8 @@ static void TestRunner_addFailure(TestListner* self,Test* test,char* msg,int lin
}
stdimpl_print(msg);
stdimpl_print("\n");
TestRunnerHadErrors = 1;
}
static const TestListnerImplement TestRunnerImplement = {
......@@ -107,6 +110,8 @@ void TestRunner_end(void)
stdimpl_itoa(result_.failureCount, buf, 10);
stdimpl_print(buf);
stdimpl_print("\n");
TestRunnerHadErrors = 1;
} else {
stdimpl_print("\nOK (");
stdimpl_itoa(result_.runCount, buf, 10);
......
......@@ -43,6 +43,8 @@ void TestRunner_start(void);
void TestRunner_runTest(Test* test);
void TestRunner_end(void);
extern int TestRunnerHadErrors;
#ifdef __cplusplus
}
#endif
......
......@@ -58,6 +58,11 @@ int main(void)
/* put test TEST_RUN() calls here */
TESTS_END();
#if defined (BOARD_NATIVE) && !defined (OUTPUT)
void _exit(int);
_exit(TestRunnerHadErrors);
#endif
lpm_set(LPM_POWERDOWN);
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment