summaryrefslogtreecommitdiffstats
path: root/test/afb-test.sh
blob: 317c615b5f406b37e2e7b32cf050176c02b0f233 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh -x

BINDER=$(command -v afb-daemon)
CLIENT=$(command -v afb-client-demo)
AFBTEST="$(pkg-config --variable libdir afb-test)/aft.so"
PROCNAME="aft-low-can"
PORT=1234
TOKEN=
LOGPIPE="test.log"
[ "$1" ] && BUILDDIR="$1" || exit 1

[ ! -p $LOGPIPE ] && mkfifo $LOGPIPE

pkill $PROCNAME

${BINDER} --name="${PROCNAME}" \
--port="${PORT}" \
--roothttp=. \
--tracereq=common \
--token=${TOKEN} \
--workdir="${BUILDDIR}/package-test" \
--binding="../package/lib/afb-low-can.so" \
--binding="$AFBTEST" \
-vvv \
--call="aft-low-can/launch_all_tests:{}" \
-vvv > ${LOGPIPE} 2>&1 &

while read -r line
do
	[ "$(echo "${line}" | grep 'NOTICE: Browser URL=')" ] && break
done < ${LOGPIPE}

${CLIENT} ws://localhost:${PORT}/api?token=${TOKEN} aft-low-can exit

rm -f ${LOGPIPE}