runall.sh 906 Bytes
Newer Older
1
#!/bin/bash
2

3
4
5
6
7
8
9
10
11
CONSOLE="${OPENBUS_HOME}/bin/busconsole"

if [ "$1" == "DEBUG" ]; then
	CONSOLE="$CONSOLE -d"
elif [ "$1" != "RELEASE" ]; then
	echo "Usage: runall.sh [RELEASE|DEBUG]"
	exit 1
fi

12
TEST_PRELUDE='package.path=package.path..";"..(os.getenv("OPENBUS_CORE_LUA") or "../lua").."/?.lua"'
13

Renato Figueiro Maia's avatar
Renato Figueiro Maia committed
14
LUACASES="\
15
16
openbus/test/core/services/LoginDB \
openbus/test/core/Protocol \
17
openbus/test/core/admin/admin \
Renato Figueiro Maia's avatar
Renato Figueiro Maia committed
18
"
19
20
for case in ${LUACASES}; do
	echo -n "Test '${case}' ... "
21
	$CONSOLE -e "$TEST_PRELUDE" ${case}.lua || exit $?
22
23
24
	echo "OK"
done

25
26
27
28
29
30
31
32
33
34
35
36
37
TEST_RUNNER="local suite = require('openbus.test.core.services.Suite')
local Runner = require('loop.test.Results')
local path = {}
for name in string.gmatch('$2', '[^.]+') do
	path[#path+1] = name
end
local runner = Runner{
	reporter = require('loop.test.Reporter'),
	path = (#path > 0) and path or nil,
}
runner('OpenBus', suite)"

$CONSOLE -e "$TEST_RUNNER" || exit $?