mirror of
https://https.git.savannah.gnu.org/git/gettext.git
synced 2026-01-26 07:37:57 +00:00
* gettext-tools/src/read-po-internal.h: Renamed from gettext-tools/src/po-gram.h. * gettext-tools/src/read-po-lex.h: Renamed from gettext-tools/src/po-lex.h. * gettext-tools/src/read-po-lex.c: Renamed from gettext-tools/src/po-lex.c. * gettext-tools/src/read-po-gram.y: Renamed from gettext-tools/src/po-gram-gen.y. * gettext-tools/src/*.h: Update. * gettext-tools/src/*.c: Update. * gettext-tools/src/FILES: Update. * gettext-tools/src/Makefile.am: Update. * gettext-tools/libgettextpo/Makefile.am: Update.
49 lines
1.5 KiB
Plaintext
49 lines
1.5 KiB
Plaintext
Code coverage
|
|
=============
|
|
|
|
Documentation:
|
|
https://gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html
|
|
http://ltp.sourceforge.net/coverage/lcov.php
|
|
https://wiki.documentfoundation.org/Development/Lcov
|
|
https://linux.die.net/man/1/lcov
|
|
|
|
0. Use lcov 1.12 or newer.
|
|
Make sure that /etc/lcovrc or your ~/.lcovrc contains
|
|
geninfo_auto_base = 1
|
|
(Without it, you get many more warnings in step 4.)
|
|
|
|
1. Configure in source directory (no VPATH build) with
|
|
$ ./configure CC="gcc --coverage" CPPFLAGS=-Wall
|
|
Why in the source directory?
|
|
Because in a VPATH build, there are more files that create trouble in
|
|
steps 4 and 5 (read-po-gram.[yc], cldr-plurals.[yc], and more).
|
|
|
|
2. Compile:
|
|
$ make
|
|
This step creates many *.gcno files.
|
|
|
|
3. Run:
|
|
$ rm -f `find . -name '*.gcda'`
|
|
$ make check
|
|
This step creates many *.gcda files.
|
|
|
|
4. $ lcov --capture --directory . --output-file coverage.info
|
|
You get warnings about
|
|
c-ctype.h ostream.h ostream.oo.h styled-ostream.h term-ostream.h unistr.h xalloc.h
|
|
plural.c plural.y
|
|
Handle them by making symlinks:
|
|
$ for f in c-ctype.h ostream.h ostream.oo.h styled-ostream.h term-ostream.h unistr.h xalloc.h; do
|
|
ln -sf ../gnulib-lib/$f gettext-tools/src/$f
|
|
done
|
|
$ for f in plural.c plural.y; do
|
|
ln -sf ../../gettext-runtime/intl/$f gettext-tools/intl/$f
|
|
ln -sf ../../gettext-runtime/intl/$f gettext-tools/src/$f
|
|
done
|
|
|
|
5. $ genhtml coverage.info --output-directory lcov.out
|
|
|
|
6. $ xdg-open lcov.out/index.html
|
|
|
|
7. When done:
|
|
$ rm -f `find . -name '*.gcno'` `find . -name '*.gcda'`
|