6 void TEST_Fail(string cond)
8 printf("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)))
31 printf("%d tests failed\n", f);
36 printf("All tests OK\n", f);
41 float TEST_Run(string s)
43 printf("%s: testing...\n", s);
44 TEST_failed = TEST_ok = 0;
45 callfunction(strcat("_TEST_", s));
48 printf("%s: %d items failed.\n", s, TEST_failed);
53 printf("%s: did not complete.\n", s);