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 |