]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/blob - src/forb/src/forbrun/tests/forbrun.sh
a7b4c90cf6919464284ef5cf9a7882cc145ffa81
[frescor/frsh-forb.git] / src / forb / src / forbrun / tests / forbrun.sh
1 #!/bin/bash
2
3 . $(dirname $0)/wvtest.sh
4
5 WVSTART "Without any parameters do nothing"
6 WVPASS forbrun
7
8 WVSTART "argv[0] in forb_main() contains the name of the library"
9 WVFAIL sh -c 'forbrun libtest_obj.so 2> error'
10 WVPASSEQ "$(cat error)" "Usage: libtest_obj.so <string>"
11
12 WVSTART "Both server and client in a single process"
13 WVPASS sh -c 'forbrun libtest_obj.so "Hello" -- libtest_client.so > output'
14 WVPASSEQ "$(cat output)" "Hello"
15
16 WVSTART "Server and client in separate processes"
17 # Run server on background
18 rm -f test.pid
19 WVPASS sh -c 'forbrun --daemon=test.pid libtest_obj.so "Hello" > output'
20 WVPASS test -f test.pid
21
22 # Run client
23 WVPASS forbrun libtest_client.so
24 WVPASS kill $(cat test.pif)
25
26 # Test whether the server was called
27 WVPASSEQ "$(cat output)" "Hello"
28