Xonotic
test.qc
Go to the documentation of this file.
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"
, f);
10
return
true
;
11
}
12
else
13
{
14
LOG_INFO
(
"All tests OK"
);
15
return
false
;
16
}
17
}
18
19
bool
TEST_Run
(
string
s)
20
{
21
LOG_INFOF
(
"%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_INFOF
(
"%s: %d items failed."
, s,
TEST_failed
);
30
return
false
;
31
}
32
else
if
(!
TEST_ok
)
33
{
34
LOG_INFOF
(
"%s: did not complete."
, s);
35
return
false
;
36
}
37
return
true
;
38
}
TEST_Run
bool TEST_Run(string s)
Definition:
test.qc:19
test.qh
TEST_RunAll_accumulated
int TEST_RunAll_accumulated(int init)
isfunction
float isfunction(string function_name)
LOG_INFOF
#define LOG_INFOF(...)
Definition:
log.qh:71
strcat
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
callfunction
void callfunction(...)
TEST_failed
int TEST_failed
Definition:
test.qh:75
LOG_INFO
#define LOG_INFO(...)
Definition:
log.qh:70
TEST_fatal
int TEST_fatal
Definition:
test.qh:73
RUN_ALL_TESTS
bool RUN_ALL_TESTS()
Definition:
test.qc:4
TEST_ok
bool TEST_ok
Definition:
test.qh:74
lib
test.qc
Generated on Thu Mar 17 2022 17:26:29 for Xonotic by
1.8.13