Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit 986620a

Browse files
committed
Merge pull request #220 from swift-nav/fix_check_issues
Improved readme, coverage script.
2 parents 0516bab + fee2135 commit 986620a

File tree

5 files changed

+35
-11
lines changed

5 files changed

+35
-11
lines changed

DEVELOPMENT.md renamed to DEVELOPMENT.rst

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ libswiftnav development
44
Follow these instructions if you intend to make changes to libswiftnav.
55

66
Tools needed:
7-
* doxygen
8-
* convert from ImageMagick
9-
* pip install gcovr diff-cover
7+
- doxygen
8+
- convert from ImageMagick
9+
- pip install gcovr diff-cover
1010

1111
To get started, run::
12+
1213
./checks/setup-hooks.sh [DIR]
1314

1415
from within the libswiftnav root directory. The default build-dir will be `build`.
@@ -18,3 +19,18 @@ inside it, and installs a git pre-commit hook that runs style and code-coverage
1819
in this build directory. These checks require doxygen, gcovr, and diff-cover
1920

2021
To manually run the coverage task, use `make check-coverage`. For syntax, use `make check-style`.
22+
23+
Issues
24+
======
25+
26+
**"No lines with coverage information in this diff."**
27+
28+
You may see this in the output from diff-cover.
29+
30+
Did you set up your build with::
31+
32+
cmake -DCMAKE_BUILD_TYPE=Coverage ..
33+
34+
or with the :code:`setup-hooks.sh` script? The :code:`Coverage` flag is
35+
required. If you are manually running the coverage script, make sure you run
36+
it from within your build directory.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Full documentation available online at http://docs.swift-nav.com/libswiftnav
1212

1313
For installation, see docs/install.dox
1414

15+
For development help, see DEVELOPMENT.rst.

checks/run-coverage.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# requires gcovr and diff-cover
22
# pip install gcovr diff-cover
33
set -e
4-
gcovr -r .. --object-directory . --xml -o ../.coverage.xml
5-
gcovr -r .. --object-directory . --html -o coverage.html
6-
( cd .. && diff-cover .coverage.xml --fail-under=85 --html-report .diffreport.html )
7-
mv ../.diffreport.html ./diffreport.html
4+
base="$(git rev-parse --show-toplevel)"
5+
echo "running coverage check from ${base}"
6+
gcovr -r "${base}" --object-directory . --xml -o "${base}/.coverage.xml"
7+
gcovr -r "${base}" --object-directory . --html -o coverage.html
8+
( cd "${base}" && diff-cover .coverage.xml --fail-under=85 --html-report .diffreport.html )
9+
mv "${base}/.diffreport.html" ./diffreport.html

src/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ add_custom_command(
7474
VERBATIM
7575
COMMAND "${PROJECT_SOURCE_DIR}/checks/checkoutput.sh"
7676
"${PROJECT_SOURCE_DIR}/src/*.c"
77-
"${PROJECT_SOURCE_DIR}/checks/checkpatch.pl"
78-
)
77+
"${PROJECT_SOURCE_DIR}/checks/checkpatch.pl")
7978

8079
add_custom_target(checkpatch DEPENDS checkpatch_output.txt)

tests/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,19 @@ else (CMAKE_CROSSCOMPILING)
5252
COMMAND test_libswiftnav
5353
)
5454

55+
add_custom_target(clean_profiling
56+
COMMAND find . -name "*.gcno" -delete
57+
COMMAND find . -name "*.gcda" -delete
58+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
59+
)
60+
5561
# for convenience:
5662
add_custom_target(tests
57-
DEPENDS test_libswiftnav
63+
DEPENDS test_libswiftnav clean_profiling
5864
COMMAND test_libswiftnav
5965
)
6066
add_custom_target(test
61-
DEPENDS test_libswiftnav
67+
DEPENDS test_libswiftnav clean_profiling
6268
COMMAND test_libswiftnav
6369
)
6470

0 commit comments

Comments
 (0)