tests/test.lua

changeset 787
c4a4d5604549
parent 760
90ce865eebd8
child 807
ce39abe0259a
equal deleted inserted replaced
786:f2dc6118b3f4 787:c4a4d5604549
161 function runtest(f, msg) 161 function runtest(f, msg)
162 if not f then print("SUBTEST NOT FOUND: "..(msg or "(no description)")); return; end 162 if not f then print("SUBTEST NOT FOUND: "..(msg or "(no description)")); return; end
163 local success, ret = pcall(f); 163 local success, ret = pcall(f);
164 if success and verbosity >= 2 then 164 if success and verbosity >= 2 then
165 print("SUBTEST PASSED: "..(msg or "(no description)")); 165 print("SUBTEST PASSED: "..(msg or "(no description)"));
166 elseif (not success) and verbosity >= 1 then 166 elseif (not success) and verbosity >= 0 then
167 print("SUBTEST FAILED: "..(msg or "(no description)")); 167 print("SUBTEST FAILED: "..(msg or "(no description)"));
168 error(ret, 0); 168 error(ret, 0);
169 end 169 end
170 end 170 end
171 171

mercurial