Add instructions for code coverage

This commit is contained in:
Hugh Bellamy 2018-09-18 15:04:44 +01:00
Родитель 850a20f2a2
Коммит 00260262d1
3 изменённых файлов: 30 добавлений и 0 удалений

8
.gitignore поставляемый
Просмотреть файл

@ -86,3 +86,11 @@ Icon
Network Trash Folder
Temporary Items
.apdisk
# gcc coverage testing tool files
*.gcno
*.gcda
*.gcov
coverage.info
/coverage

Просмотреть файл

@ -60,6 +60,21 @@ To run the tests with Clang sanitizers, run the following command from the root
./autogen.sh --enable-asan
make check
### Code coverage
Code coverage stats are generated with `lcov`. You can use [Homebrew](https://brew.sh/) on **OSX** to install the dependencies:
brew install lcov
To run the tests with code coverage, run the following commands from the root of the repository:
./autogen.sh --enable-coverage
make check
lcov --capture --directory src --output-file coverage.info
genhtml coverage.info --output-directory coverage
To view the coverage report, navigate to the `coverage` directory in the root of the repository and open `index.html`.
### Installing libgdiplus
Run the following command from the root of the repository:

Просмотреть файл

@ -46,6 +46,13 @@ if test $asan = "yes"; then
LDFLAGS="$LDFLAGS -fsanitize=address,signed-integer-overflow,undefined"
fi
AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage],[Enable code coverage.]),[coverage=yes],[coverage=no])
if test $coverage = "yes"; then
GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS --coverage -g"
LDFLAGS="$LDFLAGS --coverage"
fi
CAIRO_LIBS="`pkg-config --libs cairo `"
CAIRO_CFLAGS="`pkg-config --cflags cairo `"
cairo_info="`pkg-config --modversion cairo ` (system)"