Merge pull request #1788 from BytesGalore/extern_C_in_headers_tests

c++: tests/unittests: add extern C in header files
dev/timer
DangNhat Pham-Huu 9 years ago
commit fc4cf69376

@ -35,6 +35,10 @@
#ifndef __HELPERMACRO_H__
#define __HELPERMACRO_H__
#ifdef __cplusplus
extern "C" {
#endif
#define EMB_UNIT_TESTCASE(ca,sup,tdw,run) \
static const TestCase ca = new_TestCase(#ca,sup,tdw,run)
@ -56,4 +60,8 @@
#define EMB_UNIT_REPEATEDTEST(repeater,test,tmrp) \
static const RepeatedTest repeater = new_RepeatedTest(test,tmrp)
#ifdef __cplusplus
}
#endif
#endif/*__HELPERMACRO_H__*/

@ -35,6 +35,10 @@
#ifndef __REPEATEDTEST_H__
#define __REPEATEDTEST_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct __RepeatedTest RepeatedTest;
typedef struct __RepeatedTest* RepeatedTestRef; /*downward compatible*/
@ -53,4 +57,8 @@ extern const TestImplement RepeatedTestImplement;
tmrp,\
}
#ifdef __cplusplus
}
#endif
#endif/*__REPEATEDTEST_H__*/

@ -35,6 +35,10 @@
#ifndef __TEST_H__
#define __TEST_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct __TestResult TestResult;
typedef struct __TestResult* TestResultRef;/*downward compatible*/
@ -62,4 +66,8 @@ struct __Test {
#define Test_run(s,r) ((Test*)s)->isa->run(s,r)
#define Test_countTestCases(s) ((Test*)s)->isa->countTestCases(s)
#ifdef __cplusplus
}
#endif
#endif/*__TEST_H__*/

@ -35,6 +35,10 @@
#ifndef __TESTCALLER_H__
#define __TESTCALLER_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct __TestFixture TestFixture;
typedef struct __TestFixture* TestFixtureRef;/*downward compatible*/
@ -69,4 +73,8 @@ extern const TestImplement TestCallerImplement;
fixtuers,\
}
#ifdef __cplusplus
}
#endif
#endif/*__TESTCALLER_H__*/

@ -35,6 +35,10 @@
#ifndef __TESTCASE_H__
#define __TESTCASE_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct __TestCase TestCase;
typedef struct __TestCase* TestCaseRef;/*compatible embUnit1.0*/
@ -57,4 +61,8 @@ extern const TestImplement TestCaseImplement;
runTest,\
}
#ifdef __cplusplus
}
#endif
#endif/*__TESTCASE_H__*/

@ -35,6 +35,10 @@
#ifndef __TESTLISTENER_H__
#define __TESTLISTENER_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct __TestListnerImplement TestListnerImplement;
typedef struct __TestListnerImplement* TestListnerImplementRef;/*downward compatible*/
@ -59,4 +63,8 @@ struct __TestListner {
#define TestListner_endTest(s,t) ((TestListner*)s)->isa->endTest(s,t)
#define TestListner_addFailure(s,t,m,l,f) ((TestListner*)s)->isa->addFailure(s,t,m,l,f)
#ifdef __cplusplus
}
#endif
#endif/*__TESTLISTENER_H__*/

@ -35,6 +35,10 @@
#ifndef __TESTSUITE_H__
#define __TESTSUITE_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct __TestSuite TestSuite;
typedef struct __TestSuite* TestSuiteRef;/*downward compatible*/
@ -55,4 +59,8 @@ extern const TestImplement TestSuiteImplement;
tests,\
}
#ifdef __cplusplus
}
#endif
#endif/*__TESTSUITE_H__*/

@ -35,6 +35,10 @@
#ifndef __CONFIG_H__
#define __CONFIG_H__
#ifdef __cplusplus
extern "C" {
#endif
/* #define NO_STDIO_PRINTF*/
#ifdef NO_STDIO_PRINTF
extern void stdimpl_print(const char *string);
@ -45,4 +49,8 @@
#define ASSERT_STRING_BUFFER_MAX 64
#ifdef __cplusplus
}
#endif
#endif/*__CONFIG_H__*/

@ -47,4 +47,12 @@
#include <embUnit/AssertImpl.h>
#include <embUnit/HelperMacro.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif/*__EMBUNIT_H__*/

@ -37,6 +37,14 @@
#include "Outputter.h"
#ifdef __cplusplus
extern "C" {
#endif
OutputterRef CompilerOutputter_outputter(void);
#ifdef __cplusplus
}
#endif
#endif/*__COMPILEROUTPUTTER_H__*/

@ -37,6 +37,10 @@
#include <embUnit/embUnit.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct __OutputterImplement OutputterImplement;
typedef struct __OutputterImplement* OutputterImplementRef;
@ -71,4 +75,8 @@ struct __Outputter {
#define Outputter_printFailure(o,t,m,l,f,c) (o)->isa->printFailure(o,t,m,l,f,c)
#define Outputter_printStatistics(o,r) (o)->isa->printStatistics(o,r)
#ifdef __cplusplus
}
#endif
#endif/*__OUTPUTTER_H__*/

@ -37,6 +37,14 @@
#include "Outputter.h"
#ifdef __cplusplus
extern "C" {
#endif
OutputterRef TextOutputter_outputter(void);
#ifdef __cplusplus
}
#endif
#endif/*__TEXTOUTPUTTER_H__*/

@ -39,10 +39,18 @@
#include <embUnit/embUnit.h>
#ifdef __cplusplus
extern "C" {
#endif
void TextUIRunner_setOutputter(OutputterRef outputter);
void TextUIRunner_startWithOutputter(OutputterRef outputter);
void TextUIRunner_start(void);
void TextUIRunner_runTest(TestRef test);
void TextUIRunner_end(void);
#ifdef __cplusplus
}
#endif
#endif/*__TEXTUIRUNNER_H__*/

@ -37,7 +37,15 @@
#include "Outputter.h"
#ifdef __cplusplus
extern "C" {
#endif
void XMLOutputter_setStyleSheet(char *style);
OutputterRef XMLOutputter_outputter(void);
#ifdef __cplusplus
}
#endif
#endif/*__XMLOUTPUTTER_H__*/

@ -29,6 +29,10 @@
#ifndef MAP_H_INCLUDED
#define MAP_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#define EVAL0(...) __VA_ARGS__
#define EVAL1(...) EVAL0 (EVAL0 (EVAL0 (__VA_ARGS__)))
#define EVAL2(...) EVAL1 (EVAL1 (EVAL1 (__VA_ARGS__)))
@ -48,4 +52,8 @@
#define MAP1(f, x, peek, ...) f(x) MAP_NEXT (peek, MAP0) (f, peek, __VA_ARGS__)
#define MAP(f, ...) EVAL (MAP1 (f, __VA_ARGS__, (), 0))
#ifdef __cplusplus
}
#endif
#endif

@ -20,6 +20,10 @@
#include "../unittests.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The entry point of this test suite.
*/
@ -74,5 +78,9 @@ Test *tests_core_priority_queue_tests(void);
*/
Test *tests_core_byteorder_tests(void);
#ifdef __cplusplus
}
#endif
#endif /* __TESTS_CORE_H_ */
/** @} */

@ -20,6 +20,10 @@
#include "../unittests.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The entry point of this test suite.
*/
@ -32,5 +36,9 @@ void tests_lib(void);
*/
Test *tests_lib_ringbuffer_tests(void);
#ifdef __cplusplus
}
#endif
#endif /* __TESTS_CORE_H_ */
/** @} */

@ -20,10 +20,18 @@
#include "../unittests.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The entry point of this test suite.
*/
void tests_pktbuf(void);
#ifdef __cplusplus
}
#endif
#endif /* __TESTS_PKTBUF_H_ */
/** @} */

@ -20,10 +20,19 @@
#include "../unittests.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The entry point of this test suite.
*/
void tests_pktqueue(void);
#ifdef __cplusplus
}
#endif
#endif /* __TESTS_PKTQUEUE_H_ */
/** @} */

@ -21,6 +21,10 @@
#include "../unittests.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The entry point of this test suite.
*/
@ -33,5 +37,9 @@ void tests_timex(void);
*/
Test *tests_timex_tests(void);
#ifdef __cplusplus
}
#endif
#endif /* __TESTS_TIMEX_H_ */
/** @} */

@ -19,6 +19,10 @@
#ifndef __UNITTESTS__H
#define __UNITTESTS__H
#ifdef __cplusplus
extern "C" {
#endif
#include "embUnit/embUnit.h"
#ifdef OUTPUT
@ -48,4 +52,8 @@
# define TESTS_END() TestRunner_end()
#endif
#ifdef __cplusplus
}
#endif
#endif

Loading…
Cancel
Save