runtest.sh 716 Bytes
Newer Older
1 2
#!/bin/bash

3 4 5
mode=$1
testcase=$2
services="server"
6

7
runconsole="source ${OPENBUS_SDKLUA_TEST}/runconsole.sh $mode"
8

9
if [[ "$mode" != "DEBUG" && "$mode" != "RELEASE" ]]; then
10
	echo "Usage: $0 <RELEASE|DEBUG> <test> [services...]"
11 12 13 14 15 16 17
	exit 1
fi

if [[ ${#@} > 2 ]]; then
	services="${@:3:${#@}}"
fi

18
cd $testcase
19 20
pid=
for service in $services; do
21
	echo "Starting service '$service' of test '$testcase'"
22
	$runconsole $service.lua $testcase &
23
	pid="$pid $!"
24
	trap "kill $pid > /dev/null 2>&1" 0
25 26
done

27
echo -n "Executing test '$testcase' ... "
28
$runconsole client.lua $testcase
29
echo "OK"
30
cd ../../test
31
echo -n "Test protocol with server of test '$testcase' ... "
32
$runconsole openbus/test/Protocol.lua
33 34
echo "OK"
cd ../interop