]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/test.qh
yEnc binary-to-text encoding with tests
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / test.qh
index 2890fcaf92f7012e0d8352eeecef69589a026de4..2f4f2dee5a429a4bd203ad6d5ba0cfc26c142d9f 100644 (file)
@@ -1,15 +1,20 @@
 #ifndef TEST_H
 #define TEST_H
 
-#define TEST_Check(cond) \
-       MACRO_BEGIN \
-       { \
-               if (!(cond)) TEST_Fail( #cond); \
-       } MACRO_END
+#define TEST(id) \
+       void _TEST_##id(); \
+       [[accumulate]] int TEST_RunAll_accumulated(int f) { \
+               if (!TEST_Run(#id)) ++f; \
+               return = f; \
+       } \
+       void _TEST_##id()
+
+#define TEST_Check(cond) MACRO_BEGIN { if (!(cond)) TEST_Fail(#cond); } MACRO_END
 
 void TEST_OK();
 void TEST_Fail(string cond);
 
-float TEST_RunAll();
-float TEST_Run(string test);
+bool TEST_RunAll();
+bool TEST_Run(string test);
+
 #endif