forked from jonreid/XcodeCoverage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getcov
executable file
·48 lines (41 loc) · 892 Bytes
/
getcov
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
#!/bin/sh
#
# Copyright 2012 Jonathan M. Reid. See LICENSE.txt
# Created by: Jon Reid, http://qualitycoding.org/
# Source: https://github.com/jonreid/XcodeCoverage
#
source envcov.sh
remove_old_report()
{
pushd ${BUILT_PRODUCTS_DIR}
if [ -e lcov ]; then
rm -r lcov
fi
popd
}
enter_lcov_dir()
{
cd ${BUILT_PRODUCTS_DIR}
mkdir lcov
cd lcov
}
gather_coverage()
{
"${LCOV}" --capture -b "${SRCROOT}" -d "${OBJ_DIR}" -o ${LCOV_INFO}
}
exclude_data()
{
"${LCOV}" --remove ${LCOV_INFO} "/Applications/Xcode.app/*" -d "${OBJ_DIR}" -o ${LCOV_INFO}
"${LCOV}" --remove ${LCOV_INFO} "main.m" -d "${OBJ_DIR}" -o ${LCOV_INFO}
# Remove other patterns here...
}
generate_report()
{
"${LCOV_PATH}/genhtml" --output-directory . ${LCOV_INFO}
open index.html
}
remove_old_report
enter_lcov_dir
gather_coverage
exclude_data
generate_report