-
Notifications
You must be signed in to change notification settings - Fork 29
/
gcov.sh
executable file
·51 lines (39 loc) · 997 Bytes
/
gcov.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
#!/bin/bash
# This file is part of Firejail project
# Copyright (C) 2014-2020 Firejail Authors
# License GPL v2
gcov_init() {
USER=`whoami`
fdns --help > /dev/null
sudo chown $USER:$USER `find .`
}
generate() {
lcov -q --capture -d src/fdns --output-file gcov-file-new
lcov --add-tracefile gcov-file-old --add-tracefile gcov-file-new --output-file gcov-file
rm -fr gcov-dir
genhtml -q gcov-file --output-directory gcov-dir
sudo rm `find . -name *.gcda`
cp gcov-file gcov-file-old
gcov_init
}
# disable apparmor temporarily
sudo apparmor_parser -R /etc/apparmor.d/usr.bin.fdns 2>&1 > /dev/null
gcov_init
lcov -q --capture -d src/fdns --output-file gcov-file-old
sudo test/fdns/forwarder.exp
generate
sleep 2
sudo test/fdns/whitelist.exp
generate
sleep 2
sudo test/fdns/whitelist-file.exp
generate
sleep 2
sudo test/fdns/test-url-list.exp
generate
sleep 2
make test
generate
sleep 2
# enable apparmor back
sudo apparmor_parser -r /etc/apparmor.d/usr.bin.fdns 2>&1 > /dev/null