*.dll
*.exe
*.exp
+*.gcda
+*.gcno
*.h.c
*.ilk
*.lib
/avprobe
/avserver
/config.*
+/coverage.info
/version.h
/doc/*.1
/doc/*.html
/doc/avoptions_format.texi
/doc/doxy/html/
/doc/print_options
+/lcov/
/libavcodec/*_tablegen
/libavcodec/*_tables.c
/libavcodec/*_tables.h
$(RM) $(ALLPROGS)
$(RM) $(CLEANSUFFIXES)
$(RM) $(CLEANSUFFIXES:%=tools/%)
+ $(RM) -rf coverage.info lcov
distclean::
$(RM) $(DISTCLEANSUFFIXES)
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
-CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver
+CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.gcno *.gcda
DISTCLEANSUFFIXES = *.pc
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
ar_default="lib"
target_os_default="win32"
;;
+ gcov)
+ add_cflags -fprofile-arcs -ftest-coverage
+ add_ldflags -fprofile-arcs -ftest-coverage
+ ;;
?*)
die "Unknown toolchain $toolchain"
;;
Please refer to @url{fate.html}.
+@subsection Visualizing Test Coverage
+
+The Libav 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 Libav, 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
fate-list:
@printf '%s\n' $(sort $(FATE))
+coverage.info: TAG = LCOV
+coverage.info:
+ $(M)lcov -d $(CURDIR) -b $(SRC_PATH) --capture -o $@
+
+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:
-include $(wildcard tests/*.d)
-.PHONY: fate*
+.PHONY: fate* lcov lcov-reset
+.INTERMEDIATE: coverage.info