forked from beyond-all-reason/Beyond-All-Reason
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run an extra test on headless checking for errors at infolog.txt.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-- 'hidden' test checking infolog.txt for errors, used by headless runs. | ||
|
||
local maxErrors = 10 | ||
|
||
local function skipErrors(line) | ||
if string.find(line, 'Could not finalize projectile-texture atlas', nil, true) then | ||
return true | ||
end | ||
end | ||
|
||
local function infologTest() | ||
local errors = {} | ||
local infolog = VFS.LoadFile("infolog.txt") | ||
if infolog then | ||
local fileLines = string.lines(infolog) | ||
for i, line in ipairs(fileLines) do | ||
if string.find(line, 'Error:', nil, true) and not skipErrors(line) then | ||
errors[#errors+1] = line | ||
if #errors > maxErrors then | ||
return errors | ||
end | ||
end | ||
end | ||
end | ||
return errors | ||
end | ||
|
||
|
||
function test() | ||
local errors = infologTest() | ||
if #errors > 0 then | ||
error(table.concat(errors, "\n"), 0) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters