forked from RJ/ketama
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build_and_test_all.sh
executable file
·67 lines (57 loc) · 1.34 KB
/
build_and_test_all.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH
#Clean up test files
rm c_test.out php_test.out python_test.out java_test.out erlang_test.out lua_test.out
#Build and test C
cd libketama
./configure --with-fnv
make clean
make
sudo make install
./ketama_test ../ketama.servers aab
#Build and test python
cd ../python_ketama
python setup.py bdist_egg
sudo easy_install dist/ketama-0.1.8-py2.7-linux-x86_64.egg
python test_ketama.py aab
#Build and test php
cd ../php_ketama
phpize
./configure
make clean
make
sudo make install
php ketama_test.php aab
#Build and test lua
cd ../lua_ketama
make clean
make
lua test.lua
#Build and test java
cd ../java_ketama
mvn clean
mvn install
cd ../java_ketama_test
mvn clean
mvn package
java -jar target/java_ketama_test-1.0.jar ../ketama.servers ../java_test.out
#Build and test erlang
cd ../erlang
erl -noshell -eval 'ketama:start_link(),
ketama:getserver("test"),
init:stop().'
#Test the output files
echo "Testing the output files from all languages"
cd ../
diff c_test.out php_test.out
diff c_test.out python_test.out
diff c_test.out lua_test.out
diff c_test.out java_test.out
diff c_test.out erlang_test.out
#Display sha1 hash of file
sha1sum c_test.out
sha1sum php_test.out
sha1sum python_test.out
sha1sum erlang_test.out
sha1sum java_test.out
sha1sum lua_test.out