forked from github/server
some test cases for e2 fixed
This commit is contained in:
parent
6c7ae2dea2
commit
cc82fc01a9
|
@ -1 +1 @@
|
||||||
maxnmrs = 500
|
maxnmrs = 1000
|
||||||
|
|
|
@ -71,8 +71,12 @@ function process(orders)
|
||||||
plan_monsters()
|
plan_monsters()
|
||||||
|
|
||||||
local nmrs = get_nmrs(1)
|
local nmrs = get_nmrs(1)
|
||||||
if nmrs >= 80 then
|
-- nmrs = 0
|
||||||
print("Shit. More than 80 factions with 1 NMR (" .. nmrs .. ")")
|
if maxnmrs == nil then
|
||||||
|
maxnmrs = 80
|
||||||
|
end
|
||||||
|
if nmrs >= maxnmrs then
|
||||||
|
print("Shit. More than " .. maxnmrs .. " factions with 1 NMR (" .. nmrs .. ")")
|
||||||
write_summary()
|
write_summary()
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
|
@ -749,8 +749,18 @@ function test_storage()
|
||||||
end
|
end
|
||||||
|
|
||||||
loadscript("extensions.lua")
|
loadscript("extensions.lua")
|
||||||
tests = {
|
e3only = {
|
||||||
|
["canoe"] = test_canoe,
|
||||||
|
["morale"] = test_morale,
|
||||||
|
["owners"] = test_owners,
|
||||||
|
["taxes"] = test_taxes,
|
||||||
|
["spells"] = test_spells,
|
||||||
["alliance"] = test_alliance,
|
["alliance"] = test_alliance,
|
||||||
|
["leave"] = test_leave,
|
||||||
|
["market"] = test_market
|
||||||
|
}
|
||||||
|
|
||||||
|
tests = {
|
||||||
["pure"] = test_pure,
|
["pure"] = test_pure,
|
||||||
["read_write"] = test_read_write,
|
["read_write"] = test_read_write,
|
||||||
["control"] = test_control,
|
["control"] = test_control,
|
||||||
|
@ -761,43 +771,53 @@ tests = {
|
||||||
["message"] = test_message,
|
["message"] = test_message,
|
||||||
["hashtable"] = test_hashtable,
|
["hashtable"] = test_hashtable,
|
||||||
["gmtool"] = test_gmtool,
|
["gmtool"] = test_gmtool,
|
||||||
["leave"] = test_leave,
|
|
||||||
["events"] = test_events,
|
["events"] = test_events,
|
||||||
["produce"] = test_produce,
|
["produce"] = test_produce,
|
||||||
["rename"] = test_rename,
|
["rename"] = test_rename,
|
||||||
["recruit"] = test_recruit,
|
["recruit"] = test_recruit,
|
||||||
["recruit2"] = test_recruit2,
|
["recruit2"] = test_recruit2,
|
||||||
["spells"] = test_spells,
|
|
||||||
["herbalism"] = test_herbalism,
|
["herbalism"] = test_herbalism,
|
||||||
["storage"] = test_storage,
|
["storage"] = test_storage,
|
||||||
["taxes"] = test_taxes,
|
|
||||||
["mallorn"] = test_mallorn,
|
["mallorn"] = test_mallorn,
|
||||||
["upkeep"] = test_upkeep,
|
["upkeep"] = test_upkeep,
|
||||||
["id"] = test_id,
|
["id"] = test_id,
|
||||||
["work"] = test_work,
|
["work"] = test_work,
|
||||||
["morale"] = test_morale,
|
|
||||||
["owners"] = test_owners,
|
|
||||||
["canoe"] = test_canoe,
|
|
||||||
["plane"] = test_plane,
|
["plane"] = test_plane,
|
||||||
["guard"] = test_guard,
|
["guard"] = test_guard
|
||||||
["market"] = test_market
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mytests = {
|
mytests = {
|
||||||
["guard"] = test_guard,
|
["guard"] = test_guard,
|
||||||
["plane"] = test_plane,
|
["plane"] = test_plane,
|
||||||
["owners"] = test_owners
|
["owners"] = test_owners
|
||||||
}
|
}
|
||||||
|
|
||||||
fail = 0
|
fail = 0
|
||||||
for k, v in pairs(tests) do
|
|
||||||
local status, err = pcall(v)
|
thetests = tests
|
||||||
if not status then
|
|
||||||
fail = fail + 1
|
function test(tests)
|
||||||
print("[FAIL] " .. k .. ": " .. err)
|
for k, v in pairs(tests) do
|
||||||
else
|
local status, err = pcall(v)
|
||||||
print("[OK] " .. k)
|
if not status then
|
||||||
|
fail = fail + 1
|
||||||
|
print("[FAIL] " .. k .. ": " .. err)
|
||||||
|
else
|
||||||
|
print("[OK] " .. k)
|
||||||
|
end
|
||||||
end
|
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()
|
-- spells_csv()
|
||||||
|
|
||||||
if fail > 0 then
|
if fail > 0 then
|
||||||
|
|
Loading…
Reference in New Issue