2 #include "../dpdefs/csprogsdefs.qh"
6 #include "../dpdefs/dpextensions.qh"
13 void TEST_Fail(string cond)
15 printf("Assertion failed: ", cond);
28 float n = numentityfields();
29 for(int i = 0; i < n; ++i)
31 string name = entityfieldname(i);
32 if(substring(name, 0, 6) == "_TEST_")
33 if(!TEST_Run(substring(name, 6, -1)))
38 printf("%d tests failed\n", f);
43 printf("All tests OK\n", f);
48 float TEST_Run(string s)
50 printf("%s: testing...\n", s);
51 TEST_failed = TEST_ok = 0;
52 callfunction(strcat("_TEST_", s));
55 printf("%s: %d items failed.\n", s, TEST_failed);
60 printf("%s: did not complete.\n", s);