coverage: test compile leptonica
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
from cffi import FFI
|
||||
|
||||
ffibuilder = FFI()
|
||||
ffibuilder.set_source("ocrmypdf.lib._leptonica", None)
|
||||
ffibuilder.cdef("""
|
||||
typedef signed char l_int8;
|
||||
typedef unsigned char l_uint8;
|
||||
@@ -324,5 +323,7 @@ lept_free(void *ptr);
|
||||
""")
|
||||
|
||||
|
||||
ffibuilder.set_source("ocrmypdf.lib._leptonica", None)
|
||||
|
||||
if __name__ == '__main__':
|
||||
ffibuilder.compile(verbose=True)
|
||||
|
||||
@@ -78,3 +78,12 @@ def test_pickle(crom_pix):
|
||||
pickled = dumps(pix)
|
||||
pix2 = loads(pickled)
|
||||
assert pix.mode == pix2.mode
|
||||
|
||||
|
||||
def test_leptonica_compile(tmpdir):
|
||||
from ocrmypdf.lib.compile_leptonica import ffibuilder
|
||||
|
||||
# Compile the library but build it somewhere that won't interfere with
|
||||
# existing compiled library. Also compile in API mode so that we test
|
||||
# the interfaces, even though we use it ABI mode.
|
||||
ffibuilder.compile(tmpdir=tmpdir, target=(tmpdir /'lepttest.*'))
|
||||
|
||||
Reference in New Issue
Block a user