This is Unofficial EPICS BASE Doxygen Site
epicsUnitTest.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * EPICS BASE is distributed subject to a Software License Agreement found
5 * in file LICENSE that is included with this distribution.
6 \*************************************************************************/
7 
148 #ifndef INC_epicsUnitTest_H
149 #define INC_epicsUnitTest_H
150 
151 #include <stdarg.h>
152 
153 #include "compilerDependencies.h"
154 #include "libComAPI.h"
155 
156 #ifdef __cplusplus
157 extern "C" {
158 #endif
159 
164 LIBCOM_API void testPlan(int tests);
165 
176 LIBCOM_API int testOk(int pass, const char *fmt, ...)
177  EPICS_PRINTF_STYLE(2, 3);
182 #define testOk1(cond) testOk(cond, "%s", #cond)
183 
189 LIBCOM_API int testOkV(int pass, const char *fmt, va_list pvar);
195 LIBCOM_API void testPass(const char *fmt, ...)
196  EPICS_PRINTF_STYLE(1, 2);
201 LIBCOM_API void testFail(const char *fmt, ...)
202  EPICS_PRINTF_STYLE(1, 2);
214 LIBCOM_API void testSkip(int skip, const char *why);
218 LIBCOM_API void testTodoBegin(const char *why);
221 LIBCOM_API void testTodoEnd(void);
226 LIBCOM_API void testAbort(const char *fmt, ...)
227  EPICS_PRINTF_STYLE(1, 2);
234 LIBCOM_API int testDiag(const char *fmt, ...)
235  EPICS_PRINTF_STYLE(1, 2);
238 LIBCOM_API int testDone(void);
239 
249 LIBCOM_API
250 int testImpreciseTiming(void);
251 
259 typedef int (*TESTFUNC)(void);
262 LIBCOM_API void testHarness(void);
263 LIBCOM_API void testHarnessExit(void *dummy);
264 LIBCOM_API void runTestFunc(const char *name, TESTFUNC func);
265 
269 #define runTest(func) runTestFunc(#func, func)
270 
272 #define testHarnessDone() testHarnessExit(0)
273 
275 #ifdef __cplusplus
276 }
277 #endif
278 
279 #endif /* INC_epicsUnitTest_H */
LIBCOM_API void LIBCOM_API int LIBCOM_API int testDone(void)
Mark the end of testing.
LIBCOM_API void LIBCOM_API void testFail(const char *fmt,...) EPICS_PRINTF_STYLE(1
Failing test result with printf-style description.
LIBCOM_API void testAbort(const char *fmt,...) EPICS_PRINTF_STYLE(1
Stop testing, program cannot continue.
LIBCOM_API int testOk(int pass, const char *fmt,...) EPICS_PRINTF_STYLE(2
Test result with printf-style description.
LIBCOM_API int testImpreciseTiming(void)
Return non-zero in shared/oversubscribed testing envrionments.
LIBCOM_API void testHarness(void)
Initialize test harness.
LIBCOM_API void LIBCOM_API int testDiag(const char *fmt,...) EPICS_PRINTF_STYLE(1
Output additional diagnostics.
#define EPICS_PRINTF_STYLE(f, a)
LIBCOM_API void testPlan(int tests)
Declare the test plan, required.
LIBCOM_API void testTodoBegin(const char *why)
Mark the start of a group of tests that are expected to fail.
epics::pvData::PVStructurePtr dummy
Definition: pvAccess.cpp:72
LIBCOM_API void testPass(const char *fmt,...) EPICS_PRINTF_STYLE(1
Passing test result with printf-style description.
LIBCOM_API void testHarnessExit(void *dummy)
LIBCOM_API int testOkV(int pass, const char *fmt, va_list pvar)
Test result with var-args description.
Compiler specific declarations.
int(* TESTFUNC)(void)
LIBCOM_API void testTodoEnd(void)
Mark the end of a failing test group.
LIBCOM_API void testSkip(int skip, const char *why)
Place-holders for tests that can&#39;t be run.
LIBCOM_API void runTestFunc(const char *name, TESTFUNC func)