2015-02-13 16:03:05 +01:00
|
|
|
-- Tests that work in all games. With game config of E2.
|
|
|
|
-- Tests are under scripts/test/e2 and all files must be in scripts/test/e2/init.lua
|
|
|
|
|
|
|
|
path = 'scripts'
|
|
|
|
if config.install then
|
|
|
|
path = config.install .. '/' .. path
|
|
|
|
package.path = package.path .. ';' .. config.install .. '/lunit/?.lua'
|
2015-03-13 20:39:36 +01:00
|
|
|
--needed to find lunit if not run from eressea root. Needs right [lua] install setting in eressea.ini (point to eressea root from the start folder)
|
2015-02-13 16:03:05 +01:00
|
|
|
end
|
|
|
|
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
|
|
|
|
|
|
|
|
config.rules = 'e2'
|
|
|
|
|
|
|
|
require 'eressea'
|
|
|
|
require 'eressea.xmlconf'
|
|
|
|
require 'eressea.path'
|
|
|
|
require 'tests.e2'
|
|
|
|
require 'lunit'
|
|
|
|
|
|
|
|
rules = require('eressea.' .. config.rules)
|
2015-02-20 20:28:36 +01:00
|
|
|
result = lunit.main()
|
2015-05-21 08:27:07 +02:00
|
|
|
return result.errors + result.failed
|