-void _xbt_test(xbt_test_unit_t u, const char*file,int line, const char *fmt, ...)_XBT_GNUC_PRINTF(4,5);
-#define xbt_test0(fmt) _xbt_test(_unit,__FILE__,__LINE__,fmt)
-#define xbt_test1(fmt,a) _xbt_test(_unit,__FILE__,__LINE__,fmt,a)
-#define xbt_test2(fmt,a,b) _xbt_test(_unit,__FILE__,__LINE__,fmt,a,b)
-#define xbt_test3(fmt,a,b,c) _xbt_test(_unit,__FILE__,__LINE__,fmt,a,b,c)
-#define xbt_test4(fmt,a,b,c,d) _xbt_test(_unit,__FILE__,__LINE__,fmt,a,b,c,d)
-#define xbt_test5(fmt,a,b,c,d,e) _xbt_test(_unit,__FILE__,__LINE__,fmt,a,b,c,d,e)
-
-void _xbt_test_fail(xbt_test_unit_t u, const char*file,int line, const char *fmt, ...) _XBT_GNUC_PRINTF(4,5);
-#define xbt_test_fail0(fmt) _xbt_test_fail(_unit, __FILE__, __LINE__, fmt)
-#define xbt_test_fail1(fmt,a) _xbt_test_fail(_unit, __FILE__, __LINE__, fmt,a)
-#define xbt_test_fail2(fmt,a,b) _xbt_test_fail(_unit, __FILE__, __LINE__, fmt,a,b)
-#define xbt_test_fail3(fmt,a,b,c) _xbt_test_fail(_unit, __FILE__, __LINE__, fmt,a,b,c)
-#define xbt_test_fail4(fmt,a,b,c,d) _xbt_test_fail(_unit, __FILE__, __LINE__, fmt,a,b,c,d)
-#define xbt_test_fail5(fmt,a,b,c,d,e) _xbt_test_fail(_unit, __FILE__, __LINE__, fmt,a,b,c,d,e)
-
-void _xbt_test_log (xbt_test_unit_t u, const char*file,int line, const char *fmt, ...)_XBT_GNUC_PRINTF(4,5);
-#define xbt_test_log0(fmt) _xbt_test_log(_unit, __FILE__, __LINE__, fmt)
-#define xbt_test_log1(fmt,a) _xbt_test_log(_unit, __FILE__, __LINE__, fmt,a)
-#define xbt_test_log2(fmt,a,b) _xbt_test_log(_unit, __FILE__, __LINE__, fmt,a,b)
-#define xbt_test_log3(fmt,a,b,c) _xbt_test_log(_unit, __FILE__, __LINE__, fmt,a,b,c)
-#define xbt_test_log4(fmt,a,b,c,d) _xbt_test_log(_unit, __FILE__, __LINE__, fmt,a,b,c,d)
-#define xbt_test_log5(fmt,a,b,c,d,e) _xbt_test_log(_unit, __FILE__, __LINE__, fmt,a,b,c,d,e)
-
-void _xbt_test_expect_failure(xbt_test_unit_t unit);
-#define xbt_test_expect_failure() _xbt_test_expect_failure(_unit)
-
-void _xbt_test_skip(xbt_test_unit_t unit);
-#define xbt_test_skip() _xbt_test_skip(_unit)
-
-/* test suite short-cut macros */
-#define XBT_TEST_UNIT(name) \
- static void name(xbt_test_unit_t _unit)
-
-#endif /* _TS_H_ */
-
+XBT_PUBLIC void _xbt_test_add(const char* file, int line, const char* fmt, ...) XBT_ATTRIB_PRINTF(3, 4);
+XBT_PUBLIC void _xbt_test_fail(const char* file, int line, const char* fmt, ...) XBT_ATTRIB_PRINTF(3, 4);
+XBT_PUBLIC void _xbt_test_log(const char* file, int line, const char* fmt, ...) XBT_ATTRIB_PRINTF(3, 4);
+/** @brief Declare that a new test begins (printf-like parameters, describing the test)
+ * @hideinitializer */
+#define xbt_test_add(...) _xbt_test_add(__FILE__, __LINE__, __VA_ARGS__)
+/** @brief Declare that the lastly started test failed (printf-like parameters, describing failure cause)
+ * @hideinitializer */
+#define xbt_test_fail(...) _xbt_test_fail(__FILE__, __LINE__, __VA_ARGS__)
+/** @brief The lastly started test is actually an assert
+ * @hideinitializer
+ *
+ * - If provided a uniq parameter, this is assumed to be a condition that is expected to be true
+ * - If provided more parameters, the first one is a condition, and the other ones are printf-like arguments that are
+ * to be displayed when the condition fails.
+ */
+#define xbt_test_assert(...) _XBT_IF_ONE_ARG(_xbt_test_assert_ARG1, \
+ _xbt_test_assert_ARGN, \
+ __VA_ARGS__)(__VA_ARGS__)
+#define _xbt_test_assert_ARG1(cond) _xbt_test_assert_CHECK(cond, "%s", #cond)
+#define _xbt_test_assert_ARGN(cond, ...) _xbt_test_assert_CHECK(cond, __VA_ARGS__)
+#define _xbt_test_assert_CHECK(cond, ...) \
+ do { if (!(cond)) xbt_test_fail(__VA_ARGS__); } while (0)
+/** @brief Report some details to help debugging when the test fails (shown only on failure)
+ * @hideinitializer */
+#define xbt_test_log(...) _xbt_test_log(__FILE__, __LINE__, __VA_ARGS__)
+
+/** @brief Declare that the lastly started test failed because of the provided exception */
+XBT_PUBLIC void xbt_test_exception(xbt_ex_t e);
+
+/** @brief Declare that the lastly started test was expected to fail (and actually failed) */
+XBT_PUBLIC void xbt_test_expect_failure();
+/** @brief Declare that the lastly started test should be skipped today */
+XBT_PUBLIC void xbt_test_skip();
+
+/** @} */
+
+SG_END_DECL()
+#endif /* XBT_CUNIT_H_ */