]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/test.qc
Merge branch 'terencehill/menu_fixes' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / test.qc
1 #include "test.qh"
2
3 int TEST_RunAll_accumulated(int init);
4 bool RUN_ALL_TESTS()
5 {
6         int f = TEST_RunAll_accumulated(0);
7         if (f)
8         {
9                 LOG_INFOF("%d tests failed\n", f);
10                 return true;
11         }
12         else
13         {
14                 LOG_INFO("All tests OK\n");
15                 return false;
16         }
17 }
18
19 bool TEST_Run(string s)
20 {
21         LOG_INFOF("%s: testing...\n", s);
22         TEST_failed = 0;
23         TEST_fatal = 0;
24         TEST_ok = false;
25         callfunction(strcat("_TEST_", s));
26         if (TEST_failed > 0)
27         {
28                 LOG_INFOF("%s: %d items failed.\n", s, TEST_failed);
29                 return false;
30         }
31         else if (!TEST_ok)
32         {
33                 LOG_INFOF("%s: did not complete.\n", s);
34                 return false;
35         }
36         return true;
37 }