server/scripts/run-tests-e3.lua

33 lines
931 B
Lua
Raw Normal View History

-- Tests that work in E3. With game config of E3.
-- Tests are under scripts/test/e3 and all files must be in scripts/test/e3/init.lua
2020-04-19 21:35:48 +02:00
lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then
2020-04-19 21:35:48 +02:00
module = lunit.module
end
2020-04-19 21:35:48 +02:00
path = 'scripts'
if config.install then
path = config.install .. '/' .. path
end
package.path = path .. '/?.lua;' .. path .. '/?/init.lua;' .. package.path
config.rules = 'e3'
require 'eressea'
require 'eressea.path'
require 'eressea.xmlconf'
require 'tests.e3'
2017-05-04 06:44:33 +02:00
rng.inject(0)
eressea.settings.set("rules.alliances", "0")
eressea.settings.set("rules.food.flags", "4")
eressea.settings.set("rules.ship.damage.nocrew", "0")
eressea.settings.set("rules.ship.drifting", "0")
eressea.settings.set("rules.ship.storms", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
rules = require('eressea.' .. config.rules)
result = lunit.main()
return result.errors + result.failed