Suppress some LeakSanitizer errors in unit tests

The fontconfig library has some (intentional) memory leaks which
must be suppressed for unit tests with the LeakSanitizer.

This fixes the issues #3156 and #3157.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2020-12-04 07:24:11 +01:00
parent ac116d1b28
commit 5eb5e6ea23
2 changed files with 12 additions and 0 deletions

View File

@ -15,6 +15,9 @@ TESTING_DIR=$(shell cd $(top_srcdir) && pwd)/test/testing
# (using submodule test).
TESTDATA_DIR=$(shell cd $(top_srcdir) && pwd)/test/testdata
# Suppress some memory leaks reported by LeakSanitizer.
export LSAN_OPTIONS=suppressions=$(top_srcdir)/unittest/tesseract_leaksanitizer.supp
AM_CPPFLAGS += -DTESSBIN_DIR="\"$(abs_top_builddir)\""
AM_CPPFLAGS += -DLANGDATA_DIR="\"$(LANGDATA_DIR)\""
AM_CPPFLAGS += -DTESSDATA_DIR="\"$(TESSDATA_DIR)\""

View File

@ -0,0 +1,9 @@
# Suppress memory leaks.
# Use with LSAN_OPTIONS=suppressions=tesseract_lsan.supp
leak:FcPatternObjectAddWithBinding
leak:FcPatternObjectInsertElt
leak:FcValueListAppend
leak:FcValueListDuplicate
leak:FcValueListPrepend
leak:IA__FcLangSetCreate
leak:IA__FcValueSave