4 void TEST_Fail(string cond)
6 print(sprintf("Assertion failed: ", cond));
19 float n = numentityfields();
21 for(i = 0; i < n; ++i)
23 string name = entityfieldname(i);
24 if(substring(name, 0, 6) == "_TEST_")
25 if(!TEST_Run(substring(name, 6, -1)))
30 print(sprintf("%d tests failed\n", f));
35 print(sprintf("All tests OK\n", f));
40 float TEST_Run(string s)
42 print(sprintf("%s: testing...\n", s));
43 TEST_failed = TEST_ok = 0;
44 callfunction(strcat("_TEST_", s));
47 print(sprintf("%s: %d items failed.\n", s, TEST_failed));
52 print(sprintf("%s: did not complete.\n", s));