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();
30 for(i = 0; i < n; ++i)
32 string name = entityfieldname(i);
33 if(substring(name, 0, 6) == "_TEST_")
34 if(!TEST_Run(substring(name, 6, -1)))
39 printf("%d tests failed\n", f);
44 printf("All tests OK\n", f);
49 float TEST_Run(string s)
51 printf("%s: testing...\n", s);
52 TEST_failed = TEST_ok = 0;
53 callfunction(strcat("_TEST_", s));
56 printf("%s: %d items failed.\n", s, TEST_failed);
61 printf("%s: did not complete.\n", s);