-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·114 lines (97 loc) · 2.71 KB
/
build.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
run_gcc_tests() {
# cd external/protobuf/
# ./autogen.sh
# ./configure
# make -j12
# sudo make install
# sudo ldconfig
# cd ../../
# cd external/protobuf-c/
# ./autogen.sh
# ./configure
# make -j12
# sudo make install
# sudo ldconfig
# cd ../../
rm -rf build/
mkdir -p build/
cd build/
if [ "$1" = "clang" ] ; then
cmake .. -DCONFIG_USE_CLANG=on
else
cmake ..
fi
make -j12
cd ..
sudo python ./testing/test_socket.py
sudo python ./testing/test_logger.py
./build/TestExecutor list_test
./build/TestExecutor prng_test
./build/TestExecutor fsapi_test
./build/TestExecutor tokparse_test
./build/TestExecutor sysioctl_test
./build/TestExecutor pthread_test
./build/TestExecutor sched_test
#./build/TestExecutor crypto_test
./build/TestExecutor config_parser_test ./tests/supervisor.conf
./build/TestExecutor config_parser_test
./build/TestExecutor dlist_test
./build/TestExecutor static_list_test
./build/TestExecutor stack_test
./build/TestExecutor queue_test
./build/TestExecutor fifo_test
#./build/TestExecutor ssl_test server&
#./build/TestExecutor ssl_test client&
sleep 1
#./build/TestExecutor hashtbl_test
#./build/TestExecutor msg_queue_test server /mq_test&
#./build/TestExecutor msg_queue_test client /mq_test&
./build/TestExecutor evtloop_test server&
./build/TestExecutor evtloop_test client&
sleep 1
./build/TestExecutor rawsock_test
sudo ./build/TestExecutor rawsock_test sender
toch f
./build/TestExecutor monitor_test f&
touch f
sleep 1
echo "test complete.."
exit 0
}
make_release() {
rm -rf release/
rm -rf build/
mkdir -p build/
cd build/
if [ "$1" = "clang" ] ; then
cmake .. -DCONFIG_RELEASE=on -DCONFIG_SHAREDLIB=on -DCONFIG_USE_CLANG=on
else
cmake .. -DCONFIG_RELEASE=on -DCONFIG_SHAREDLIB=on
fi
make -j12
if [ "$?" -ne 0 ] ; then
echo "failed to generate a release image.. check your tests"
exit 1
fi
cd ..
mkdir -p release/lib/
mkdir -p release/inc/edgeos/
# unstripped bin and lib
cp -r build/libEdgeOS.a release/lib/
cp -r build/EdgeOSLogger release/lib/
# cp incls
find ./lib/ -iname *.h | xargs -i cp {} release/inc/edgeos/
find ./lib/ -iname *.hpp | xargs -i cp {} release/inc/edgeos/
while read -r version
do
ver_str=$version;
done < version.txt
tar -zcvf edgeos_release-${ver_str}.tar release/
sha1sum edgeos_release-${ver_str}.tar > release.sha1sum
}
if [ "$1" = "run_gcc_tests" ] ; then
run_gcc_tests $1
elif [ "$1" = "make_release" ] ; then
make_release $2
fi