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
|
|
|
|
|
2021-02-22 01:53:01 +01:00
|
|
|
config.rules = 'e2'
|
|
|
|
lunit = require 'lunit'
|
2020-05-03 16:52:40 +02:00
|
|
|
if _VERSION >= 'Lua 5.2' then
|
2021-02-22 01:53:01 +01:00
|
|
|
module = lunit.module
|
2015-02-13 16:03:05 +01:00
|
|
|
end
|
|
|
|
|
2021-02-22 01:53:01 +01:00
|
|
|
require 'eressea.path'
|
2015-02-13 16:03:05 +01:00
|
|
|
require 'eressea'
|
|
|
|
require 'eressea.xmlconf'
|
|
|
|
require 'tests.e2'
|
|
|
|
|
2017-05-04 06:44:33 +02:00
|
|
|
rng.inject(0)
|
2018-02-06 18:46:28 +01:00
|
|
|
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")
|
2015-02-13 16:03:05 +01:00
|
|
|
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
|