Merge branch 'develop' of github.com:ennorehling/eressea into develop

This commit is contained in:
Enno Rehling 2016-02-13 07:28:36 +01:00
commit ec216643c3
5 changed files with 12 additions and 7 deletions

View File

@ -19,4 +19,4 @@ inifile
s/runtests s/runtests
cd tests cd tests
./write-reports.sh ./write-reports.sh
#./run-turn.sh ./run-turn.sh

View File

@ -60,7 +60,7 @@ local function write_emails(locales)
end end
local function join_path(a, b) local function join_path(a, b)
if a then return a .. '/' .. b if a then return a .. '/' .. b end
return b return b
end end
@ -99,7 +99,9 @@ local function write_htpasswd()
local out = io.open(join_path(config.basepath, "htpasswd"), "w") local out = io.open(join_path(config.basepath, "htpasswd"), "w")
if out then if out then
for f in factions() do for f in factions() do
out:write(itoa36(f.id) .. ":" .. f.password .. "\n") if f.password then
out:write(itoa36(f.id) .. ":" .. f.password .. "\n")
end
end end
out:close() out:close()
end end

View File

@ -96,7 +96,7 @@ TOLUA_PKG(game);
int log_lua_error(lua_State * L) int log_lua_error(lua_State * L)
{ {
const char *error = lua_tostring(L, -1); const char *error = lua_tostring(L, -1);
log_fatal("LUA call failed.\n%s\n", error); log_fatal("Lua call failed.\n%s\n", error);
lua_pop(L, 1); lua_pop(L, 1);
return 1; return 1;
} }
@ -1183,6 +1183,7 @@ int eressea_run(lua_State *L, const char *luafile)
err = lua_pcall(L, 1, 1, -3); err = lua_pcall(L, 1, 1, -3);
if (err != 0) { if (err != 0) {
log_lua_error(L); log_lua_error(L);
assert(!"Lua syntax error? check log.");
} }
else { else {
if (lua_isnumber(L, -1)) { if (lua_isnumber(L, -1)) {

View File

@ -194,7 +194,7 @@ void warden_add_give(unit * src, unit * u, const item_type * itype, int n)
void create_museum(void) void create_museum(void)
{ {
#if 0 /* TODO: move this to LUA. It should be possible. */ #if 0 /* TODO: move this to Lua. It should be possible. */
unsigned int museum_id = hashstring("museum"); unsigned int museum_id = hashstring("museum");
plane *museum = getplanebyid(museum_id); plane *museum = getplanebyid(museum_id);
region *r; region *r;

View File

@ -1,4 +1,4 @@
NEWFILES="data/185.dat datum parteien parteien.full passwd score turn" NEWFILES="data/185.dat datum parteien parteien.full htpasswd score turn"
cleanup () { cleanup () {
rm -rf reports $NEWFILES rm -rf reports $NEWFILES
} }
@ -19,6 +19,7 @@ expr=$2
expect=$3 expect=$3
count=`grep -cE $expr $file` count=`grep -cE $expr $file`
[ $count -eq $expect ] || quit 1 "expected $expect counts of $expr in $file, got $count" [ $count -eq $expect ] || quit 1 "expected $expect counts of $expr in $file, got $count"
echo "PASS: $expr is $expect"
} }
ROOT=`pwd` ROOT=`pwd`
@ -34,10 +35,11 @@ VALGRIND=`which valgrind`
SERVER=../Debug/eressea/eressea SERVER=../Debug/eressea/eressea
if [ -n "$VALGRIND" ]; then if [ -n "$VALGRIND" ]; then
SUPP=../share/ubuntu-12_04.supp SUPP=../share/ubuntu-12_04.supp
SERVER="$VALGRIND --suppressions=$SUPP --error-exitcode=1 --leak-check=no $SERVER" SERVER="$VALGRIND --track-origins=yes --gen-suppressions=all --suppressions=$SUPP --error-exitcode=1 --leak-check=no $SERVER"
fi fi
echo "running $SERVER" echo "running $SERVER"
$SERVER -t 184 ../scripts/run-turn.lua $SERVER -t 184 ../scripts/run-turn.lua
echo "integration tests"
[ -d reports ] || quit 4 "no reports directory created" [ -d reports ] || quit 4 "no reports directory created"
CRFILE=185-zvto.cr CRFILE=185-zvto.cr
for file in $NEWFILES reports/$CRFILE ; do for file in $NEWFILES reports/$CRFILE ; do