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