diff --git a/.gitignore b/.gitignore index 24a918963..fd1a7c349 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ Thumbs.db *.cmd tmp/ tests/config.lua +tests/reports/ +tests/data/185.dat diff --git a/conf/e2/config.json b/conf/e2/config.json index 5828ca261..0d3a94203 100644 --- a/conf/e2/config.json +++ b/conf/e2/config.json @@ -6,21 +6,21 @@ "game.id": 2, "game.name": "Eressea", "NewbieImmunity": 8, - "modules.wormholes": 1, + "modules.wormholes": true, "entertain.base": 0, "entertain.perlevel": 20, "nmr.timeout": 5, "nmr.removenewbie": 0, "GiveRestriction": 3, - "hunger.long": 1, + "hunger.long": true, "init_spells": 0, "world.era": 2, "seed.population.min": 8, "seed.population.max": 8, "rules.ship.damage_drift": 0.00, - "rules.reserve.twophase": 1, + "rules.reserve.twophase": true, "rules.give.max_men": "-1", - "rules.check_overload": 0, + "rules.check_overload": false, "rules.limit.faction": 2500, "rules.maxskills.magic": 5, "rules.guard.base_stop_prob": 0.30, diff --git a/scripts/tests/common.lua b/scripts/tests/common.lua index fb1a29965..316ff1e71 100644 --- a/scripts/tests/common.lua +++ b/scripts/tests/common.lua @@ -45,7 +45,7 @@ function test_flags() eressea.write_game("test.dat") eressea.free_game() eressea.read_game("test.dat") - os.remove('test.dat') + os.remove('data/test.dat') f = get_faction(no) assert_equal(flags, f.flags) end @@ -194,6 +194,7 @@ function test_descriptions() eressea.write_game(filename) eressea.free_game() eressea.read_game(filename) + os.remove("data/test.dat") assert_equal(info, get_ship(sno).info) assert_equal(info, get_unit(uno).info) assert_equal(info, get_faction(fno).info) @@ -1081,5 +1082,6 @@ function test_parser() eressea.read_orders(filename) process_orders() + os.remove(filename) assert_equal("Goldene Herde", u.name) end diff --git a/scripts/tests/orders.lua b/scripts/tests/orders.lua index d9443c9c4..21ecbe644 100644 --- a/scripts/tests/orders.lua +++ b/scripts/tests/orders.lua @@ -104,7 +104,7 @@ function test_process_quit() eressea.write_game('test.dat') eressea.free_game() eressea.read_game('test.dat') - os.remove('test.dat') + os.remove('data/test.dat') assert_equal(nil, _G.get_faction(fno)) end diff --git a/scripts/tests/storage.lua b/scripts/tests/storage.lua index 5c86cf90a..7e4e775e7 100644 --- a/scripts/tests/storage.lua +++ b/scripts/tests/storage.lua @@ -26,6 +26,7 @@ function test_store_unit() assert_not_nil(store) u = store:read_unit() store:close() + os.remove(filename) assert_not_nil(u) assert_equal(u:get_item("money"), u.number * 100) end diff --git a/tests/runtests.bat b/tests/runtests.bat new file mode 100644 index 000000000..3bb41c982 --- /dev/null +++ b/tests/runtests.bat @@ -0,0 +1,9 @@ +@ECHO OFF +SET BUILD=..\build-vs12\eressea\Debug\ +SET SERVER=%BUILD%\eressea.exe +%BUILD%\test_eressea.exe +%SERVER% ..\scripts\run-tests.lua +%SERVER% ..\scripts\run-tests-e2.lua +%SERVER% ..\scripts\run-tests-e3.lua +PAUSE +RMDIR /s /q reports