Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
test.qc
Go to the documentation of this file.
1#include "test.qh"
2
5{
7 if (f)
8 {
9 LOG_HELPF("%d tests failed", f);
10 return true;
11 }
12 else
13 {
14 LOG_HELP("All tests OK");
15 return false;
16 }
17}
18
19bool TEST_Run(string s)
20{
21 LOG_HELPF("%s: testing...", s);
22 TEST_failed = 0;
23 TEST_fatal = 0;
24 TEST_ok = false;
25 string fn = strcat("_TEST_", s);
26 if (isfunction(fn)) callfunction(fn);
27 if (TEST_failed > 0)
28 {
29 LOG_HELPF("%s: %d items failed.", s, TEST_failed);
30 return false;
31 }
32 else if (!TEST_ok)
33 {
34 LOG_HELPF("%s: did not complete.", s);
35 return false;
36 }
37 return true;
38}
#define LOG_HELP(...)
Definition log.qh:85
#define LOG_HELPF(...)
Definition log.qh:86
void callfunction(...)
float isfunction(string function_name)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
int TEST_RunAll_accumulated(int init)
bool RUN_ALL_TESTS()
Definition test.qc:4
bool TEST_Run(string s)
Definition test.qc:19
int TEST_failed
Definition test.qh:75
bool TEST_ok
Definition test.qh:74
int TEST_fatal
Definition test.qh:73