4 void TEST_Fail(string cond)
6 printf("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 printf("%d tests failed\n", f);
35 printf("All tests OK\n", f);
40 float TEST_Run(string s)
42 printf("%s: testing...\n", s);
43 TEST_failed = TEST_ok = 0;
44 callfunction(strcat("_TEST_", s));
47 printf("%s: %d items failed.\n", s, TEST_failed);
52 printf("%s: did not complete.\n", s);