le_test.h
Go to the documentation of this file.
1 
169 //--------------------------------------------------------------------------------------------------
177 #ifndef LEGATO_TEST_INCLUDE_GUARD
178 #define LEGATO_TEST_INCLUDE_GUARD
179 
180 
181 //--------------------------------------------------------------------------------------------------
185 //--------------------------------------------------------------------------------------------------
186 typedef struct le_test_Child* le_test_ChildRef_t;
187 
188 
189 //--------------------------------------------------------------------------------------------------
195 //--------------------------------------------------------------------------------------------------
196 void _le_test_Init(void);
197 void _le_test_Fail(void);
198 int _le_test_GetNumFailures(void);
199 le_test_ChildRef_t _le_test_Fork(const char* exePath, ...);
200 void _le_test_Join(le_test_ChildRef_t child);
201 // @}
202 
203 
204 //--------------------------------------------------------------------------------------------------
208 //--------------------------------------------------------------------------------------------------
209 #define LE_TEST_INIT _le_test_Init()
210 
211 
212 //--------------------------------------------------------------------------------------------------
219 //--------------------------------------------------------------------------------------------------
220 #define LE_TEST(testResult) if (testResult) \
221  { \
222  LE_INFO("Unit Test Passed: '%s'", #testResult); \
223  } \
224  else \
225  { \
226  LE_ERROR("Unit Test Failed: '%s'", #testResult); \
227  _le_test_Fail(); \
228  }
229 
230 
231 //--------------------------------------------------------------------------------------------------
235 //--------------------------------------------------------------------------------------------------
236 #define LE_TEST_EXIT exit(_le_test_GetNumFailures());
237 
239 #define LE_TEST_SUMMARY LE_TEST_EXIT
240 
241 
242 //--------------------------------------------------------------------------------------------------
255 //--------------------------------------------------------------------------------------------------
256 #define LE_TEST_FORK(exePath, ...) _le_test_Fork(exePath, ##__VA_ARGS__, NULL)
257 
258 
259 //--------------------------------------------------------------------------------------------------
265 //--------------------------------------------------------------------------------------------------
266 #define LE_TEST_JOIN(child) _le_test_Join(child)
267 
268 
269 #endif // LEGATO_TEST_INCLUDE_GUARD
struct le_test_Child * le_test_ChildRef_t
Definition: le_test.h:186