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

3 4
mode=$1
testcase=$2
5 6
tasks=$3
services=$4
7

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

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

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

24 25
for task in $tasks; do
	echo -n "Executing task '$task' of test '$testcase' ... "
26
	$runconsole $task.lua $testcase
27 28 29
	echo "OK"
done

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