forked from github/server
new lua test framework, work in progress.
This commit is contained in:
parent
b84bf7ba56
commit
30c1b0e1ff
17
s/cmake-init
17
s/cmake-init
|
@ -1,4 +1,20 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
ROOT=$(pwd)
|
||||||
|
while [ ! -d $ROOT/.git ]; do
|
||||||
|
ROOT=$(dirname $ROOT)
|
||||||
|
if [ "$ROOT" == "/" ; then
|
||||||
|
echo "could not find root, are you in the git repository?"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
MACHINE=`uname -m`
|
||||||
|
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
||||||
|
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
||||||
|
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
|
||||||
|
BIN_DIR="build-$MACHINE-$CC-Debug"
|
||||||
|
cd $BIN_DIR
|
||||||
|
|
||||||
if [ ! -e ../CMakeLists.txt ]; then
|
if [ ! -e ../CMakeLists.txt ]; then
|
||||||
echo "are you sure you are in the build directory?"
|
echo "are you sure you are in the build directory?"
|
||||||
exit
|
exit
|
||||||
|
@ -26,3 +42,4 @@ cmake .. \
|
||||||
-DCMAKE_INCLUDE_PATH=$INCLUDE_PATH \
|
-DCMAKE_INCLUDE_PATH=$INCLUDE_PATH \
|
||||||
-DCMAKE_PREFIX_PATH=$PREFIX_PATH \
|
-DCMAKE_PREFIX_PATH=$PREFIX_PATH \
|
||||||
-DCMAKE_INSTALL_PREFIX=$HOME/eressea $*
|
-DCMAKE_INSTALL_PREFIX=$HOME/eressea $*
|
||||||
|
cd -
|
||||||
|
|
|
@ -17,8 +17,6 @@ fi
|
||||||
|
|
||||||
echo $ROOT
|
echo $ROOT
|
||||||
$ROOT/$BIN_DIR/eressea/test_eressea
|
$ROOT/$BIN_DIR/eressea/test_eressea
|
||||||
pushd $ROOT/game-e2
|
cd $ROOT/scripts
|
||||||
$ROOT/$BIN_DIR/eressea/eressea runtests.lua
|
$ROOT/$BIN_DIR/eressea/eressea -v0 runtests.lua
|
||||||
cd $ROOT/game-e3
|
|
||||||
$ROOT/$BIN_DIR/eressea/eressea runtests.lua
|
|
||||||
popd
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
-- new tests 2014-06-11
|
||||||
|
|
||||||
|
require "lunit"
|
||||||
|
require "tests.settings"
|
||||||
|
require "tests.config"
|
||||||
|
lunit.main()
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
require "lunit"
|
||||||
|
|
||||||
|
module("tests.eressea.config", package.seeall, lunit.testcase )
|
||||||
|
|
||||||
|
function setup()
|
||||||
|
eressea.free_game()
|
||||||
|
end
|
||||||
|
|
||||||
|
function test_read()
|
||||||
|
local f
|
||||||
|
f = faction.create("orc@example.com", "orc", "en")
|
||||||
|
assert_equal(nil, f)
|
||||||
|
assert_not_nil(eressea.config)
|
||||||
|
eressea.config.parse('{ "races": { "orc" : {}}}')
|
||||||
|
f = faction.create("orc@example.com", "orc", "en")
|
||||||
|
assert_not_nil(f)
|
||||||
|
end
|
||||||
|
|
|
@ -200,3 +200,4 @@ function test_snowman()
|
||||||
end
|
end
|
||||||
assert_equal(nil, u)
|
assert_equal(nil, u)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
require "lunit"
|
||||||
|
|
||||||
|
module("tests.eressea.settings", package.seeall, lunit.testcase )
|
||||||
|
|
||||||
|
function setup()
|
||||||
|
eressea.free_game()
|
||||||
|
end
|
||||||
|
|
||||||
|
function test_settings()
|
||||||
|
assert_equal(nil, eressea.settings.get("foo"))
|
||||||
|
eressea.settings.set("foo", "bar")
|
||||||
|
assert_equal("bar", eressea.settings.get("foo"))
|
||||||
|
end
|
|
@ -258,6 +258,7 @@
|
||||||
Name="Source Files"
|
Name="Source Files"
|
||||||
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d;*.m;*.mm;*.go">
|
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d;*.m;*.mm;*.go">
|
||||||
<F N="../src/bind_building.c"/>
|
<F N="../src/bind_building.c"/>
|
||||||
|
<F N="../src/bind_config.c"/>
|
||||||
<F N="../src/bind_eressea.c"/>
|
<F N="../src/bind_eressea.c"/>
|
||||||
<F N="../src/bind_faction.c"/>
|
<F N="../src/bind_faction.c"/>
|
||||||
<F N="../src/bind_gmtool.c"/>
|
<F N="../src/bind_gmtool.c"/>
|
||||||
|
@ -272,6 +273,7 @@
|
||||||
<F N="../src/bind_storage.c"/>
|
<F N="../src/bind_storage.c"/>
|
||||||
<F N="../src/bind_unit.c"/>
|
<F N="../src/bind_unit.c"/>
|
||||||
<F N="../src/bindings.c"/>
|
<F N="../src/bindings.c"/>
|
||||||
|
<F N="../src/config.pkg.c"/>
|
||||||
<F N="../src/console.c"/>
|
<F N="../src/console.c"/>
|
||||||
<F N="../src/eressea.pkg.c"/>
|
<F N="../src/eressea.pkg.c"/>
|
||||||
<F N="../src/gmtool.c"/>
|
<F N="../src/gmtool.c"/>
|
||||||
|
@ -286,6 +288,7 @@
|
||||||
Name="Header Files"
|
Name="Header Files"
|
||||||
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
|
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
|
||||||
<F N="../src/bind_building.h"/>
|
<F N="../src/bind_building.h"/>
|
||||||
|
<F N="../src/bind_config.h"/>
|
||||||
<F N="../src/bind_eressea.h"/>
|
<F N="../src/bind_eressea.h"/>
|
||||||
<F N="../src/bind_faction.h"/>
|
<F N="../src/bind_faction.h"/>
|
||||||
<F N="../src/bind_gmtool.h"/>
|
<F N="../src/bind_gmtool.h"/>
|
||||||
|
|
|
@ -117,7 +117,6 @@
|
||||||
</Includes>
|
</Includes>
|
||||||
<Libs PreObjects="0">
|
<Libs PreObjects="0">
|
||||||
<Lib File="%bderessea.a"/>
|
<Lib File="%bderessea.a"/>
|
||||||
<Lib File="/usr/lib/i386-linux-gnu/libxml2.a"/>
|
|
||||||
<Lib File="/usr/lib/i386-linux-gnu/libm.a"/>
|
<Lib File="/usr/lib/i386-linux-gnu/libm.a"/>
|
||||||
</Libs>
|
</Libs>
|
||||||
</Config>
|
</Config>
|
||||||
|
@ -233,7 +232,6 @@
|
||||||
</Includes>
|
</Includes>
|
||||||
<Libs PreObjects="0">
|
<Libs PreObjects="0">
|
||||||
<Lib File="%bderessea.a"/>
|
<Lib File="%bderessea.a"/>
|
||||||
<Lib File="/usr/lib/i386-linux-gnu/libxml2.a"/>
|
|
||||||
<Lib File="/usr/lib/i386-linux-gnu/libm.a"/>
|
<Lib File="/usr/lib/i386-linux-gnu/libm.a"/>
|
||||||
</Libs>
|
</Libs>
|
||||||
</Config>
|
</Config>
|
||||||
|
@ -279,6 +277,10 @@
|
||||||
Filters="*.bmp"/>
|
Filters="*.bmp"/>
|
||||||
<Folder
|
<Folder
|
||||||
Name="Other Files"
|
Name="Other Files"
|
||||||
Filters=""/>
|
Filters="">
|
||||||
|
<F N="../scripts/tests/config.lua"/>
|
||||||
|
<F N="../scripts/runtests.lua"/>
|
||||||
|
<F N="../scripts/tests/settings.lua"/>
|
||||||
|
</Folder>
|
||||||
</Files>
|
</Files>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in New Issue