]> rtime.felk.cvut.cz Git - frescor/forb.git/blob - src/forbrun/tests/forbrun.sh
7c5fde1e573a06b12e21c40678e238e6ec5a97ce
[frescor/forb.git] / 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.pid)
25
26 # Test whether the server was called
27 WVPASSEQ "$(cat output)" "Hello"
28