blob: 634c5fc0393f03671591c44893301b7a6e189a4f (
plain)
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
|
#!/usr/bin/env bash
if ! command -v gcov > /dev/null; then
echo "Please install gcov"
exit 1
fi
if ! command -v lcov > /dev/null; then
echo "Please install lcov"
exit 1
fi
# Default make jobs
MAKE_JOBS=${MAKE_JOBS:-4}
# Default temp directory
if [ -z "${TMPDIR}" ];
then
if [ -d "${HOME}/tmp" ]; then
TMPDIR="${HOME}/tmp"
else
TMPDIR="/tmp"
fi
fi
DEBUG_CXXFLAGS="-DDEBUG -DCRYPTOPP_COVERAGE=1 -g3 -O1 -coverage"
NOASM_CXXFLAGS="-DNDEBUG -DCRYPTOPP_DISABLE_ASM -DCRYPTOPP_COVERAGE=1 -g3 -O1 -coverage"
RELEASE_CXXFLAGS="-DNDEBUG -DCRYPTOPP_COVERAGE=1 -g3 -O1 -coverage"
# Clean old artifacts
rm -rf TestCoverage/ >/dev/null
make distclean >/dev/null
lcov --base-directory . --directory . --zerocounters -q
echo "**************************************************"
echo "***** Debug build *****"
echo "**************************************************"
make clean > /dev/null
if ! CXXFLAGS="${DEBUG_CXXFLAGS}" make -j "${MAKE_JOBS}";
then
echo "Debug build failed"
exit 1
fi
./cryptest.exe v
./cryptest.exe tv all
lcov --base-directory . --directory . -c -o cryptest_debug.info
echo "**************************************************"
echo "***** No ASM build *****"
echo "**************************************************"
make clean > /dev/null
if ! CXXFLAGS="${NOASM_CXXFLAGS}" make -j "${MAKE_JOBS}";
then
echo "No ASM build failed"
exit 1
fi
./cryptest.exe v
./cryptest.exe tv all
lcov --base-directory . --directory . -c -o cryptest_noasm.info
echo "**************************************************"
echo "***** Release build *****"
echo "**************************************************"
make clean > /dev/null
if ! CXXFLAGS="${RELEASE_CXXFLAGS}" make -j "${MAKE_JOBS}";
then
echo "Release build failed"
exit 1
fi
./cryptest.exe v
./cryptest.exe tv all
./cryptest.exe b 0.5
lcov --base-directory . --directory . -c -o cryptest_release.info
echo "**************************************************"
echo "***** HTML processing *****"
echo "**************************************************"
if [ ! e cryptest_debug.info ]; then
echo "WARN: cryptest_debug.info does not exist"
fi
if [ ! e cryptest_noasm.info ]; then
echo "WARN: cryptest_noasm.info does not exist"
fi
if [ ! e cryptest_release.info ]; then
echo "WARN: cryptest_release.info does not exist"
fi
lcov --add-tracefile cryptest_debug.info --add-tracefile cryptest_noasm.info --add-tracefile cryptest_release.info -o cryptest.info
lcov --remove cryptest.info "*/adhoc*.*" -o cryptest.info
lcov --remove cryptest.info "*/fipstest*.*" -o cryptest.info
lcov --remove cryptest.info "*/fips140*.*" -o cryptest.info
lcov --remove cryptest.info "/usr/*" -o cryptest.info
genhtml -o TestCoverage/ -t "Crypto++ test coverage" --num-spaces 4 cryptest.info
exit 0
|