From da489976371eb928d8b4d004744667fdf82b90d4 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 17 Jan 2017 10:12:55 -0500 Subject: Add optional coverage flags to build This CL allows generating coverage information for the source files. By adding use_coverage=true to the GN build settings clang will generate .gcno files for each source file and executing the binary will generate a .gcda file for each source file. Those files can then be processed by llvm-cov to generate .gcov reports for each source file. i.e. (assuming use_coverage=true is set for out/coverage) * ninja -C out/coverage pdfium_unittests * cd out/coverage * find obj -name "*.o" -exec llvm-cov -af -stats {} > d.out \; There should now be .gcov files for each source file in the out/coverage directory. Note, llvm-gcov may have a different name or syntax on your machine. Change-Id: I7379579f5f20a5b8b2f3a3b409b868bba4b4d74d Reviewed-on: https://pdfium-review.googlesource.com/2216 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- pdfium.gni | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pdfium.gni') diff --git a/pdfium.gni b/pdfium.gni index df051eca81..5737224f70 100644 --- a/pdfium.gni +++ b/pdfium.gni @@ -28,4 +28,7 @@ declare_args() { # Build PDFium standalone pdf_is_standalone = false + + # Enable coverage information + use_coverage = false } -- cgit v1.2.3