-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun.sh
executable file
·61 lines (54 loc) · 1.14 KB
/
run.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
set -e
set -o pipefail
DIR=`pwd`
export CPPFLAGS=-I${DIR}/thirdparty/ps-lite/deps/include
export LDFLAGS=-L${DIR}/thirdparty/ps-lite/deps/lib
export PATH=${DIR}/thirdparty/ps-lite/deps/bin:$PATH
export LD_LIBRARY_PATH=${DIR}/thirdparty/ps-lite/deps/lib:$LD_LIBRARY_PATH
function build_all() {
cd ./thirdparty/ps-lite
make
cd -
mkdir -p build
cd ./build/
cmake ..
make
cd ..
}
function test_all() {
echo "test begin"
ls ./bin/test | while read file
do
./bin/test/$file > /dev/null
echo "test $file done"
done
echo "test all done"
}
function run_all() {
build_all
test_all
}
function main() {
local cmd=${1:-help}
case ${cmd} in
all)
run_all "$@"
;;
build)
build_all "$@"
;;
test)
test_all "$@"
;;
help)
echo "Usage: ${BASH_SOURCE} {test}"
return 0;
;;
*)
echo "unsupport command [${cmd}]"
echo "Usage: ${BASH_SOURCE} {test}"
return 1;
;;
esac
}
main "$@"