My favorites | Sign in
Project Logo
                
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
#!/bin/bash

EXIT=0
OCAML_NODE_NAME=o1
ERLANG_NODE_NAME=e1
NODE_COOKIE=cookie

echo; echo "Test $0: Run the ocaml server."
./ex_node_wc.byte -name $OCAML_NODE_NAME -cookie $NODE_COOKIE &
OCAML_PID=$!
sleep 0.1

echo; echo "Test $0: Run erlang node to interact with ocaml node."
erl -pa beam -sname $ERLANG_NODE_NAME -setcookie $NODE_COOKIE -noshell -eval "
OcamlNodes = [list_to_atom(\"$OCAML_NODE_NAME@\" ++ net_adm:localhost())],
ErlangNodes = [list_to_atom(\"$ERLANG_NODE_NAME@\" ++ net_adm:localhost())],
D = ex_wc:doit([\"test/f1.txt\", \"test/f2.txt\"], OcamlNodes, 2, ErlangNodes, 2),
1 = dict:fetch(\"one1\", D),
1 = dict:fetch(\"three1\", D),
1 = dict:fetch(\"one2\", D),
1 = dict:fetch(\"three2\", D),
2 = dict:fetch(\"two\", D),
2 = dict:fetch(\"four\", D),
ok.
" -s init stop
EXIT=$?

echo; echo "Test $0: Kill ocaml server"
kill $OCAML_PID

echo; echo "Test $0: RESULT=${EXIT} (0=ok)"
exit ${EXIT}


Show details Hide details

Change log

r51 by lcoquelle on May 20, 2008   Diff
trunk/lib/ocamerl: added a "map-reduce
style" word-count example.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 953 bytes, 34 lines

File properties

svn:executable
*
Hosted by Google Code