-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
.jenkins.sh
executable file
·62 lines (51 loc) · 1.99 KB
/
.jenkins.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
#!/bin/bash
result=0
function run_test {
printf '\e[0;36m'
echo "running test: $command $@"
printf '\e[0m'
$command "$@"
status=$?
if [ $status -ne 0 ]; then
printf '\e[0;31m'
echo "test failed: $command $@"
printf '\e[0m'
echo
result=1
else
printf '\e[0;32m'
echo OK
printf '\e[0m'
echo
fi
return 0
}
rm src/*.gc*
run_test ./autogen.sh
run_test ./configure --enable-debug
make clean
run_test make
run_test src/chinadns -h
run_test src/chinadns -V
run_test tests/test.py -a '-c chnroute.txt -l iplist.txt' -t tests/google.com
run_test tests/test.py -a '-c chnroute.txt -l iplist.txt' -t tests/facebook.com
run_test tests/test.py -a '-c chnroute.txt -s 114.114.114.114,8.8.8.8 -l iplist.txt' -t tests/google.com
run_test tests/test.py -a '-c chnroute.txt -y 0.5 -l iplist.txt' -t tests/google.com
run_test tests/test.py -a '-c chnroute.txt -b 0.0.0.0 -l iplist.txt' -t tests/google.com
run_test tests/test.py -a '-c chnroute.txt -l iplist.txt' -t tests/twitter.com
run_test tests/test.py -a '-d -c chnroute.txt -l iplist.txt' -t tests/twitter.com
run_test tests/test.py -a '-c chnroute.txt' -t tests/twitter.com
run_test tests/test.py -a '-m -c chnroute.txt' -t tests/twitter.com
run_test tests/test.py -a '-c chnroute.txt -l iplist.txt' -t tests/taobao.com
run_test tests/test.py -a '-d -c chnroute.txt -l iplist.txt' -t tests/taobao.com
run_test tests/test.py -a '-c chnroute.txt' -t tests/taobao.com
run_test tests/test.py -a '-m -c chnroute.txt' -t tests/taobao.com
run_test tests/test.py -a '-c chnroute.txt -l iplist.txt' -t tests/x_8888
run_test tests/test.py -a '-d -c chnroute.txt -l iplist.txt' -t tests/x_8888
run_test tests/test.py -a '-c chnroute.txt' -t tests/x_8888
run_test tests/test.py -a '-m -c chnroute.txt' -t tests/x_8888
gcov src/*.c
rm src/*.html
cd src && gcovr -r . --html --html-details -o index.html
gcovr -r . | grep TOTAL | rev | cut -d' ' -f 1 | rev > /tmp/chinadns-coverage
exit $result