1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

unittests: exit(1) or error

This commit is contained in:
René Kijewski 2014-05-13 07:06:03 +02:00
parent 61152df449
commit 5e6bf869b0
3 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -43,6 +43,8 @@ void TestRunner_start(void);
void TestRunner_runTest(Test* test);
void TestRunner_end(void);
extern int TestRunnerHadErrors;
#ifdef __cplusplus
}
#endif

View File

@ -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;