diff --git a/src/scripts/config-test.lua b/src/scripts/config-test.lua index 67bb64082..8ca4859e8 100644 --- a/src/scripts/config-test.lua +++ b/src/scripts/config-test.lua @@ -1 +1 @@ -maxnmrs = 500 +maxnmrs = 1000 diff --git a/src/scripts/eressea.lua b/src/scripts/eressea.lua index e12ce4c3b..cf58d5be3 100644 --- a/src/scripts/eressea.lua +++ b/src/scripts/eressea.lua @@ -71,8 +71,12 @@ function process(orders) plan_monsters() local nmrs = get_nmrs(1) - if nmrs >= 80 then - print("Shit. More than 80 factions with 1 NMR (" .. nmrs .. ")") + -- nmrs = 0 + if maxnmrs == nil then + maxnmrs = 80 + end + if nmrs >= maxnmrs then + print("Shit. More than " .. maxnmrs .. " factions with 1 NMR (" .. nmrs .. ")") write_summary() return -1 end diff --git a/src/scripts/tests.lua b/src/scripts/tests.lua index d73d14906..8bcc0541b 100644 --- a/src/scripts/tests.lua +++ b/src/scripts/tests.lua @@ -749,8 +749,18 @@ function test_storage() end loadscript("extensions.lua") -tests = { +e3only = { + ["canoe"] = test_canoe, + ["morale"] = test_morale, + ["owners"] = test_owners, + ["taxes"] = test_taxes, + ["spells"] = test_spells, ["alliance"] = test_alliance, + ["leave"] = test_leave, + ["market"] = test_market +} + +tests = { ["pure"] = test_pure, ["read_write"] = test_read_write, ["control"] = test_control, @@ -761,43 +771,53 @@ tests = { ["message"] = test_message, ["hashtable"] = test_hashtable, ["gmtool"] = test_gmtool, - ["leave"] = test_leave, ["events"] = test_events, ["produce"] = test_produce, ["rename"] = test_rename, ["recruit"] = test_recruit, ["recruit2"] = test_recruit2, - ["spells"] = test_spells, ["herbalism"] = test_herbalism, ["storage"] = test_storage, - ["taxes"] = test_taxes, ["mallorn"] = test_mallorn, ["upkeep"] = test_upkeep, ["id"] = test_id, ["work"] = test_work, - ["morale"] = test_morale, - ["owners"] = test_owners, - ["canoe"] = test_canoe, ["plane"] = test_plane, - ["guard"] = test_guard, - ["market"] = test_market + ["guard"] = test_guard } + mytests = { ["guard"] = test_guard, ["plane"] = test_plane, ["owners"] = test_owners } + fail = 0 -for k, v in pairs(tests) do - local status, err = pcall(v) - if not status then - fail = fail + 1 - print("[FAIL] " .. k .. ": " .. err) - else - print("[OK] " .. k) + +thetests = tests + +function test(tests) + for k, v in pairs(tests) do + local status, err = pcall(v) + if not status then + fail = fail + 1 + print("[FAIL] " .. k .. ": " .. err) + else + print("[OK] " .. k) + end end end +function is_e3() + free_game() + r = region.create(0, 0, "plain") + b = building.create(r, "market") + return b~=nil +end + +test(tests) +if is_e3() then test(e3only) end + -- spells_csv() if fail > 0 then