ztest: define test_main in the header file.

This also makes test_main C++ compatible by setting the linkage.

Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
Michael Hope 2018-03-19 18:38:53 +01:00 committed by Anas Nashif
parent 7383814d8b
commit d2807576ec
2 changed files with 10 additions and 2 deletions

View file

@ -13,6 +13,10 @@
#ifndef __ZTEST_H__
#define __ZTEST_H__
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup ztest Zephyr testing suite
*/
@ -49,4 +53,10 @@
#include <tc_util.h>
#include <logging/sys_log.h>
void test_main(void);
#ifdef __cplusplus
}
#endif
#endif /* __ZTEST_H__ */

View file

@ -259,8 +259,6 @@ void _ztest_run_test_suite(const char *name, struct unit_test *suite)
test_status = (test_status || fail) ? 1 : 0;
}
void test_main(void);
#ifndef KERNEL
int main(void)
{