]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/test.qh
#pragma once
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / test.qh
1 #pragma once
2
3 #define TEST(id) \
4         void _TEST_##id(); \
5         [[accumulate]] int TEST_RunAll_accumulated(int f) { \
6                 if (!TEST_Run(#id)) ++f; \
7                 return = f; \
8         } \
9         void _TEST_##id()
10
11 #define TEST_Check(cond) MACRO_BEGIN { if (!(cond)) TEST_Fail(#cond); } MACRO_END
12
13 void TEST_OK();
14 void TEST_Fail(string cond);
15
16 bool TEST_RunAll();
17 bool TEST_Run(string test);