diff options
Diffstat (limited to 'testes/all.lua')
-rw-r--r-- | testes/all.lua | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/testes/all.lua b/testes/all.lua index 8d727b6b..2e6fe038 100644 --- a/testes/all.lua +++ b/testes/all.lua | |||
@@ -5,8 +5,8 @@ | |||
5 | 5 | ||
6 | local version = "Lua 5.4" | 6 | local version = "Lua 5.4" |
7 | if _VERSION ~= version then | 7 | if _VERSION ~= version then |
8 | warn(string.format( | 8 | warn("This test suite is for ", version, |
9 | "This test suite is for %s, not for %s\nExiting tests", version, _VERSION)) | 9 | ", not for ", _VERSION, "\nExiting tests") |
10 | return | 10 | return |
11 | end | 11 | end |
12 | 12 | ||
@@ -190,16 +190,13 @@ assert(dofile('verybig.lua', true) == 10); collectgarbage() | |||
190 | dofile('files.lua') | 190 | dofile('files.lua') |
191 | 191 | ||
192 | if #msgs > 0 then | 192 | if #msgs > 0 then |
193 | warn("#tests not performed:", true) | 193 | local m = table.concat(msgs, "\n ") |
194 | for i=1,#msgs do | 194 | warn("#tests not performed:\n ", m, "\n") |
195 | warn("\n ", true); warn(msgs[i], true) | ||
196 | end | ||
197 | warn("\n") | ||
198 | end | 195 | end |
199 | 196 | ||
200 | print("(there should be two warnings now)") | 197 | print("(there should be two warnings now)") |
201 | warn("#This is ", true); warn("an expected", true); warn(" warning") | 198 | warn("#This is ", "an expected", " warning") |
202 | warn("#This is", true); warn(" another one") | 199 | warn("#This is", " another one") |
203 | 200 | ||
204 | -- no test module should define 'debug' | 201 | -- no test module should define 'debug' |
205 | assert(debug == nil) | 202 | assert(debug == nil) |
@@ -216,9 +213,10 @@ _G.showmem = showmem | |||
216 | 213 | ||
217 | end --) | 214 | end --) |
218 | 215 | ||
219 | local _G, showmem, print, format, clock, time, difftime, assert, open = | 216 | local _G, showmem, print, format, clock, time, difftime, |
217 | assert, open, warn = | ||
220 | _G, showmem, print, string.format, os.clock, os.time, os.difftime, | 218 | _G, showmem, print, string.format, os.clock, os.time, os.difftime, |
221 | assert, io.open | 219 | assert, io.open, warn |
222 | 220 | ||
223 | -- file with time of last performed test | 221 | -- file with time of last performed test |
224 | local fname = T and "time-debug.txt" or "time.txt" | 222 | local fname = T and "time-debug.txt" or "time.txt" |
@@ -262,7 +260,7 @@ if not usertests then | |||
262 | local diff = (clocktime - lasttime) / lasttime | 260 | local diff = (clocktime - lasttime) / lasttime |
263 | local tolerance = 0.05 -- 5% | 261 | local tolerance = 0.05 -- 5% |
264 | if (diff >= tolerance or diff <= -tolerance) then | 262 | if (diff >= tolerance or diff <= -tolerance) then |
265 | print(format("WARNING: time difference from previous test: %+.1f%%", | 263 | warn(format("#time difference from previous test: %+.1f%%", |
266 | diff * 100)) | 264 | diff * 100)) |
267 | end | 265 | end |
268 | assert(open(fname, "w")):write(clocktime):close() | 266 | assert(open(fname, "w")):write(clocktime):close() |