From a977e853b401ed6a598e4b0835e8bfb251910374 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 18 Apr 2020 22:34:12 +0200 Subject: [PATCH 1/9] es wird immer der erste lange Befehl ausgefuehrt. --- scripts/tests/e2/destroy.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests/e2/destroy.lua b/scripts/tests/e2/destroy.lua index 430ca301c..db6f09c2a 100644 --- a/scripts/tests/e2/destroy.lua +++ b/scripts/tests/e2/destroy.lua @@ -41,8 +41,8 @@ function test_destroy_is_long() local u = unit.create(faction.create("human", "one@example.com", "de"), r1, 10) u.building = building.create(u.region, "castle") u:clear_orders() - u:add_order("LERNE Unterhaltung") u:add_order("ZERSTOERE " .. itoa36(u.building.id)) + u:add_order("LERNE Unterhaltung") process_orders() assert_equal(0, u:get_skill("entertainment")) assert_equal(nil, u.building) From 8e7919f206ab7cb3aeee034814b5d47c22a67687 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 30 Apr 2020 19:46:23 +0200 Subject: [PATCH 2/9] clibs submodule update --- clibs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clibs b/clibs index abe774f70..484fbf23e 160000 --- a/clibs +++ b/clibs @@ -1 +1 @@ -Subproject commit abe774f70265de14ea7f5e530518ca130562a9c9 +Subproject commit 484fbf23e34f6844f1c4e3f685bb6c53cadf5bfe From 2529a781d81e5dc7fe443b879adc72697ad13cdd Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 30 Apr 2020 20:01:02 +0200 Subject: [PATCH 3/9] fix lunit --- scripts/run-tests-e2.lua | 2 +- scripts/run-tests-e3.lua | 2 +- scripts/run-tests.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/run-tests-e2.lua b/scripts/run-tests-e2.lua index b5f18c7f7..64a090108 100644 --- a/scripts/run-tests-e2.lua +++ b/scripts/run-tests-e2.lua @@ -11,11 +11,11 @@ package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' config.rules = 'e2' +lunit = require 'lunit' require 'eressea' require 'eressea.xmlconf' require 'eressea.path' require 'tests.e2' -require 'lunit' rng.inject(0) eressea.settings.set("rules.food.flags", "4") diff --git a/scripts/run-tests-e3.lua b/scripts/run-tests-e3.lua index 3332df306..43d42635e 100644 --- a/scripts/run-tests-e3.lua +++ b/scripts/run-tests-e3.lua @@ -11,11 +11,11 @@ package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' config.rules = 'e3' +lunit = require 'lunit' require 'eressea' require 'eressea.path' require 'eressea.xmlconf' require 'tests.e3' -require 'lunit' rng.inject(0) eressea.settings.set("rules.alliances", "0") diff --git a/scripts/run-tests.lua b/scripts/run-tests.lua index d1306ddcd..c41c29f01 100644 --- a/scripts/run-tests.lua +++ b/scripts/run-tests.lua @@ -9,9 +9,9 @@ if config.install then end package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' +lunit = require 'lunit' require 'eressea' require 'eressea.path' require 'tests' -require 'lunit' result = lunit.main() return result.errors + result.failed From e337fa996c468417f78ecc41eb6ec2d11c27ce4b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 1 May 2020 17:06:08 +0200 Subject: [PATCH 4/9] do not include lunit in the project, use luarocks to install --- .gitmodules | 3 --- lunit | 1 - 2 files changed, 4 deletions(-) delete mode 160000 lunit diff --git a/.gitmodules b/.gitmodules index 4d903c57f..f76a3af9c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "lunit"] - path = lunit - url = https://github.com/ennorehling/lunit.git [submodule "dlmalloc"] path = dlmalloc url = https://github.com/ennorehling/dlmalloc.git diff --git a/lunit b/lunit deleted file mode 160000 index 155c96594..000000000 --- a/lunit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 155c96594435413b4f704eb17558ea0b70631bad From 8982b649815774b1b2a64010ff563a496e7919f4 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 1 May 2020 17:12:16 +0200 Subject: [PATCH 5/9] install lunitx as part of setup --- s/cmake-init | 1 + 1 file changed, 1 insertion(+) diff --git a/s/cmake-init b/s/cmake-init index eea222334..22d98b42e 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -125,6 +125,7 @@ TOLUA else echo "tolua is $path" fi +luarocks --local install lunitx unset path set -e From bd4db1a9d8e2bd67a9647c3e58751ff64c808900 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 1 May 2020 17:23:00 +0200 Subject: [PATCH 6/9] no need to modify package.path --- scripts/eressea/path.lua | 1 - scripts/run-tests-e2.lua | 2 -- scripts/run-tests-e3.lua | 2 -- scripts/run-tests.lua | 2 -- 4 files changed, 7 deletions(-) diff --git a/scripts/eressea/path.lua b/scripts/eressea/path.lua index def970919..085cda997 100644 --- a/scripts/eressea/path.lua +++ b/scripts/eressea/path.lua @@ -3,4 +3,3 @@ if config.paths ~= nil then package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' end end --- print(package.path) diff --git a/scripts/run-tests-e2.lua b/scripts/run-tests-e2.lua index 64a090108..2495b8385 100644 --- a/scripts/run-tests-e2.lua +++ b/scripts/run-tests-e2.lua @@ -4,8 +4,6 @@ path = 'scripts' if config.install then path = config.install .. '/' .. path - package.path = package.path .. ';' .. config.install .. '/lunit/?.lua' - --needed to find lunit if not run from eressea root. Needs right [lua] install setting in eressea.ini (point to eressea root from the start folder) end package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' diff --git a/scripts/run-tests-e3.lua b/scripts/run-tests-e3.lua index 43d42635e..e6c8c9186 100644 --- a/scripts/run-tests-e3.lua +++ b/scripts/run-tests-e3.lua @@ -4,8 +4,6 @@ path = 'scripts' if config.install then path = config.install .. '/' .. path - package.path = package.path .. ';' .. config.install .. '/lunit/?.lua' - --needed to find lunit if not run form eressea root. Needs right [lua] install setting in eressea.ini (point to eressea root from the start folder) end package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' diff --git a/scripts/run-tests.lua b/scripts/run-tests.lua index c41c29f01..c14e15a3a 100644 --- a/scripts/run-tests.lua +++ b/scripts/run-tests.lua @@ -4,8 +4,6 @@ path = 'scripts' if config.install then path = config.install .. '/' .. path - package.path = package.path .. ';' .. config.install .. '/lunit/?.lua' - --needed to find lunit if not run form eressea root. Needs right [lua] install setting in eressea.ini (point to eressea root from the start folder) end package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' From f0387825cb05c6d7583e5fc7ab68f80133912f10 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 1 May 2020 17:35:45 +0200 Subject: [PATCH 7/9] include luarocks in travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d7a014d89..b702efaab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ addons: - valgrind - cppcheck - shellcheck + - luarocks os: - linux notifications: From 9f5ffe974f642a8d695b26829f4982fbdf46c46a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 1 May 2020 17:41:29 +0200 Subject: [PATCH 8/9] set luarocks path before runnign tests --- s/runtests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s/runtests b/s/runtests index b74a4b785..f62d410a5 100755 --- a/s/runtests +++ b/s/runtests @@ -1,6 +1,6 @@ #!/bin/bash set -e - +eval ($luarocks path) ROOT=$(git rev-parse --show-toplevel) [ -z $BUILD ] && BUILD=Debug ; export BUILD From c17a2ffe0226150455e686bb55612956e871f54c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 1 May 2020 17:46:14 +0200 Subject: [PATCH 9/9] typo in last commit --- s/runtests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s/runtests b/s/runtests index f62d410a5..429f8ef03 100755 --- a/s/runtests +++ b/s/runtests @@ -1,6 +1,6 @@ #!/bin/bash set -e -eval ($luarocks path) +eval $(luarocks path) ROOT=$(git rev-parse --show-toplevel) [ -z $BUILD ] && BUILD=Debug ; export BUILD