Merge commit 'a862c7d3368241e72a465ab944afa38ea62a6640'

* commit 'a862c7d3368241e72a465ab944afa38ea62a6640':
  Integrate lcov/gcov into Libav

Conflicts:
	Makefile
	common.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-04-06 13:23:38 +02:00
commit 84bfa8beb7
5 changed files with 48 additions and 14 deletions

4
.gitignore vendored
View File

@ -6,6 +6,8 @@
*.dylib
*.exe
*.exp
*.gcda
*.gcno
*.h.c
*.ilk
*.lib
@ -24,6 +26,7 @@
/ffprobe
/ffserver
/config.*
/coverage.info
/version.h
/doc/*.1
/doc/*.3
@ -44,6 +47,7 @@
/doc/fate.txt
/doc/doxy/html/
/doc/print_options
/lcov/
/libavcodec/*_tablegen
/libavcodec/*_tables.c
/libavcodec/*_tables.h

View File

@ -154,8 +154,8 @@ clean::
$(RM) $(ALLPROGS) $(ALLPROGS_G)
$(RM) $(CLEANSUFFIXES)
$(RM) $(CLEANSUFFIXES:%=tools/%)
$(RM) coverage.info
$(RM) -r coverage-html
$(RM) -rf coverage.info lcov
distclean::
$(RM) $(DISTCLEANSUFFIXES)
@ -164,15 +164,6 @@ distclean::
config:
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
# Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
$(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@
coverage-html: coverage.info
$(Q)mkdir -p $@
$(Q)genhtml -o $@ $<
$(Q)touch $@
check: all alltools examples testprogs fate
include $(SRC_PATH)/doc/Makefile

7
configure vendored
View File

@ -316,7 +316,6 @@ Optimization options (experts only):
--disable-fast-unaligned consider unaligned accesses slow
Developer options (useful when working on FFmpeg itself):
--enable-coverage build with test coverage instrumentation
--disable-debug disable debugging symbols
--enable-debug=LEVEL set the debug level [$debuglevel]
--disable-optimizations disable compiler optimizations
@ -1560,7 +1559,6 @@ CMDLINE_SELECT="
$HAVE_LIST_CMDLINE
$THREADS_LIST
asm
coverage
cross_compile
debug
extra_warnings
@ -2481,6 +2479,10 @@ case "$toolchain" in
ar_default="lib"
target_os_default="win32"
;;
gcov)
add_cflags -fprofile-arcs -ftest-coverage
add_ldflags -fprofile-arcs -ftest-coverage
;;
?*)
die "Unknown toolchain $toolchain"
;;
@ -4117,7 +4119,6 @@ enabled vdpau &&
disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
# add some useful compiler flags if supported

View File

@ -580,6 +580,30 @@ message or introductionary message for the patch series that you post to
the ffmpeg-devel mailing list, a direct link to download the sample media.
@subsection Visualizing Test Coverage
The FFmpeg build system allows visualizing the test coverage in an easy
manner with the coverage tools @code{gcov}/@code{lcov}. This involves
the following steps:
@enumerate
@item
Configure to compile with instrumentation enabled:
@code{configure --toolchain=gcov}.
@item
Run your test case, either manually or via FATE. This can be either
the full FATE regression suite, or any arbitrary invocation of any
front-end tool provided by FFmpeg, in any combination.
@item
Run @code{make lcov} to generate coverage data in HTML format.
@item
View @code{lcov/index.html} in your preferred HTML viewer.
@end enumerate
You can use the command @code{make lcov-reset} to reset the coverage
measurements. You will need to rerun @code{make lcov} after running a
new test.
@anchor{Release process}
@section Release process

View File

@ -160,6 +160,19 @@ $(FATE) $(FATE_TESTS-no): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
fate-list:
@printf '%s\n' $(sort $(FATE))
coverage.info: TAG = LCOV
coverage.info:
$(M)lcov -d $(CURDIR) -b $(SRC_PATH) --capture | sed -e 's#/./#/#g' > $@
lcov: TAG = GENHTML
lcov: coverage.info
$(M)genhtml -o $(CURDIR)/lcov $<
lcov-reset: TAG = LCOV
lcov-reset:
$(M)lcov -d $(CURDIR) --zerocounters
$(Q)$(RM) -f coverage.info
clean:: testclean
testclean:
@ -169,4 +182,5 @@ testclean:
-include $(wildcard tests/*.d)
.PHONY: fate*
.PHONY: fate* lcov lcov-reset
.INTERMEDIATE: coverage.info