diff --git a/.gitignore b/.gitignore index 24ed2df2e..78d475c70 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ build-*/ ipch/ *.log src/Release/ +game-e3/data/ +game-e3/reports/ diff --git a/configure b/configure new file mode 100755 index 000000000..8bebf3813 --- /dev/null +++ b/configure @@ -0,0 +1,32 @@ +#!/bin/sh +MACHINE=`uname -m` +BIN_DIR="build-$MACHINE-Debug" +[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" +[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc" +[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc" +[ -z "$JOBS" ] && JOBS=1 + +DISTCC=`which distcc` +if [ ! -z "$DISTCC" ] ; then +JOBS=`distcc -j` +if [ -z "$JOBS" ] ; then +JOBS=1 +elif [ $JOBS -gt 1 ] ; then +CC="distcc $CC" +MAKEOPTS=-j$JOBS +fi +fi +echo "Building with $CC and $JOBS jobs" + +mkdir -p $BIN_DIR +cd $BIN_DIR +CC="$CC" cmake .. -DCMAKE_MODULE_PATH=$PWD/../cmake/Modules -DCMAKE_BUILD_TYPE=Debug +make -j$JOBS +make test +cd .. +for GAME in game* ; do + cd $GAME + ln -sf ../$BIN_DIR/server/server + ./server -e run_tests + cd .. +done diff --git a/game-e3/eressea.ini b/game-e3/eressea.ini index 98dd9fc1b..efc181a02 100644 --- a/game-e3/eressea.ini +++ b/game-e3/eressea.ini @@ -11,7 +11,7 @@ locales = de,en [config] game = e3a source_dir = .. -maxnmrs = 10 +maxnmrs = 20 [editor] color = 1 diff --git a/quicklist b/quicklist index 23d8a36de..e9d0875c7 160000 --- a/quicklist +++ b/quicklist @@ -1 +1 @@ -Subproject commit 23d8a36de9cd909aee2aac11c18f9f1311a30b40 +Subproject commit e9d0875c703291490baec3f582a5b3d30c18f5a0 diff --git a/scripts/tests/e3a.lua b/scripts/tests/e3a.lua index cc0bf61ac..5bef245c4 100644 --- a/scripts/tests/e3a.lua +++ b/scripts/tests/e3a.lua @@ -179,6 +179,10 @@ function test_ship_capacity() update_owners() process_orders() + if r2~=u1.region then + print(get_turn(), u1, u1.faction) + write_reports() + end assert_equal(r2, u1.region) assert_not_equal(r2, u2.region) if r2~=u3.region then @@ -237,22 +241,23 @@ function test_taxes() end function test_leave() - local r = region.create(0, 0, "plain") - local f = faction.create("noreply@eressea.de", "human", "de") - f.id = 42 - local b1 = building.create(r, "castle") - b1.size = 10 - local b2 = building.create(r, "lighthouse") - b2.size = 10 - local u = unit.create(f, r, 1) - u.building = b1 - assert_not_equal(nil, u.building) - u:add_item("money", u.number * 100) - u:clear_orders() - u:add_order("BETRETE BURG " .. itoa36(b2.id)) - update_owners() - process_orders() - assert_equal(u.building.id, b1.id, "region owner has left the building") -- region owners may not leave + local r = region.create(0, 0, "plain") + local f = faction.create("noreply@eressea.de", "human", "de") + f.id = 42 + local b1 = building.create(r, "castle") + b1.size = 10 + local b2 = building.create(r, "lighthouse") + b2.size = 10 + local u = unit.create(f, r, 1) + u.building = b1 + u:add_item("money", u.number * 100) + u:clear_orders() + u:add_order("BETRETE BURG " .. itoa36(b2.id)) + process_orders() + init_reports() + write_report(u.faction) + print(u.faction) + assert_equal(b1, u.building, "region owner has left the building") -- region owners may not leave end function test_market() diff --git a/src/main.c b/src/main.c index 5180af4b0..c2fb6cc8a 100644 --- a/src/main.c +++ b/src/main.c @@ -89,6 +89,10 @@ static int parse_args(int argc, char **argv, int *exitcode) case 't': turn = atoi(argv[i][2] ? argv[i]+2 : argv[++i]); break; + case 'r': + entry_point = "run_turn"; + turn = atoi(argv[i][2] ? argv[i]+2 : argv[++i]); + break; case 'q': verbosity = 0; break;