1#!/bin/bash
2#
3# $1: path to minimal example binaries...
4#     if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES=1
5#     that will be ./bin from your build dir
6#
7# $2: path for logs and results.  The results will go
8#     in a subdir named after the directory this script
9#     is in
10#
11# $3: offset for test index count
12#
13# $4: total test count
14#
15# $5: path to ./minimal-examples dir in lws
16#
17# Test return code 0: OK, 254: timed out, other: error indication
18
19. $5/selftests-library.sh
20
21COUNT_TESTS=6
22
23dotest $1 $2 warmcat
24dotest $1 $2 warmcat-h1 --h1
25
26spawn "" $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls
27dotest $1 $2 localhost -l
28spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls
29dotest $1 $2 localhost-h1 -l --h1
30kill $SPID 2>/dev/null
31wait $SPID 2>/dev/null
32
33
34if [ -z "$TRAVIS_OS_NAME" ] ; then
35	SPID=""
36	spawn "" $5/http-server/minimal-http-server-eventlib $1/lws-minimal-http-server-eventlib --uv -s
37	dotest $1 $2 localhost-suv -l
38	spawn $SPID $5/http-server/minimal-http-server-eventlib $1/lws-minimal-http-server-eventlib --uv -s
39	dotest $1 $2 localhost-suv-h1 -l --h1
40
41	kill $SPID 2>/dev/null
42	wait $SPID 2>/dev/null
43fi
44
45exit $FAILS
46
47
48