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
7 # $2: path for logs and results. The results will go
8 # in a subdir named after the directory this script
11 # $3: offset for test index count
13 # $4: total test count
15 # $5: path to ./minimal-examples dir in lws
17 # Test return code 0: OK, 254: timed out, other: error indication
19 . $5/selftests-library.sh
26 # let's make an index with just Dorian first
28 dotest $1 $2 apitest -c -i /tmp/lws-fts-dorian.index \
29 "../minimal-examples/api-tests/api-test-fts/the-picture-of-dorian-gray.txt"
31 # and let's hear about autocompletes for "b"
33 dotest $1 $2 apitest -i /tmp/lws-fts-dorian.index b
34 cat $2/api-test-fts/apitest.log | cut -d' ' -f5- > /tmp/fts1
35 diff -urN /tmp/fts1 "../minimal-examples/api-tests/api-test-fts/canned-1.txt"
36 if [ $? -ne 0 ] ; then
38 FAILS=$(( $FAILS + 1 ))
42 # let's make an index with Dorian + Les Mis in French (ie, UTF-8) as well
44 dotest $1 $2 apitest -c -i /tmp/lws-fts-both.index \
45 "../minimal-examples/api-tests/api-test-fts/the-picture-of-dorian-gray.txt" \
46 "../minimal-examples/api-tests/api-test-fts/les-mis-utf8.txt"
48 # and let's hear about "help", which appears in both
50 dotest $1 $2 apitest -i /tmp/lws-fts-both.index -f -l help
51 cat $2/api-test-fts/apitest.log | cut -d' ' -f5- > /tmp/fts2
52 diff -urN /tmp/fts2 "../minimal-examples/api-tests/api-test-fts/canned-2.txt"
53 if [ $? -ne 0 ] ; then
55 FAILS=$(( $FAILS + 1 ))