2018-03-14 04:15:44 +08:00
|
|
|
# Absolute path of directory 'tessdata' with traineddata files
|
|
|
|
# (must be on same level as top source directory).
|
|
|
|
TESSDATA_DIR=$(shell cd $(top_srcdir) && cd .. && pwd)/tessdata
|
|
|
|
|
|
|
|
# Absolute path of directory 'testing' with test images and ground truth texts
|
2018-06-06 20:20:14 +08:00
|
|
|
# (using submodule test).
|
|
|
|
TESTING_DIR=$(shell cd $(top_srcdir) && pwd)/test/testing
|
2018-03-14 04:15:44 +08:00
|
|
|
|
|
|
|
AM_CPPFLAGS += -DTESSDATA_DIR="\"$(TESSDATA_DIR)\""
|
|
|
|
AM_CPPFLAGS += -DTESTING_DIR="\"$(TESTING_DIR)\""
|
2018-03-04 21:43:28 +08:00
|
|
|
AM_CPPFLAGS += -DPANGO_ENABLE_ENGINE
|
2018-04-26 03:33:14 +08:00
|
|
|
AM_CPPFLAGS += -I$(top_builddir)/src/api
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/api
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/arch
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/ccmain
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/ccstruct
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/ccutil
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/classify
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/cutil
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/dict
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/display
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/lstm
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/textord
|
2018-08-27 17:44:46 +08:00
|
|
|
if ENABLE_TRAINING
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/training
|
|
|
|
endif
|
2018-04-26 03:33:14 +08:00
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/viewer
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/wordrec
|
2018-03-04 21:43:28 +08:00
|
|
|
|
2017-08-19 21:12:06 +08:00
|
|
|
# Build googletest:
|
2018-06-02 06:42:37 +08:00
|
|
|
check_LTLIBRARIES = libgtest.la libgtest_main.la libgmock.la libgmock_main.la
|
2017-08-19 21:12:06 +08:00
|
|
|
libgtest_la_SOURCES = ../googletest/googletest/src/gtest-all.cc
|
2017-09-17 00:47:04 +08:00
|
|
|
libgtest_la_CPPFLAGS = -I$(top_srcdir)/googletest/googletest/include -I$(top_srcdir)/googletest/googletest -pthread
|
2017-08-19 21:12:06 +08:00
|
|
|
libgtest_main_la_SOURCES = ../googletest/googletest/src/gtest_main.cc
|
|
|
|
## libgtest_main_la_LIBADD = libgtest.la
|
|
|
|
|
2018-06-02 06:42:37 +08:00
|
|
|
GMOCK_INCLUDES = -I$(top_srcdir)/googletest/googlemock/include \
|
|
|
|
-I$(top_srcdir)/googletest/googlemock \
|
|
|
|
-I$(top_srcdir)/googletest/googletest/include \
|
|
|
|
-I$(top_srcdir)/googletest/googletest
|
|
|
|
|
|
|
|
libgmock_la_SOURCES = ../googletest/googlemock/src/gmock-all.cc
|
|
|
|
libgmock_la_CPPFLAGS = $(GMOCK_INCLUDES) \
|
|
|
|
-pthread
|
|
|
|
libgmock_main_la_SOURCES = ../googletest/googlemock/src/gmock_main.cc
|
|
|
|
libgmock_main_la_CPPFLAGS = $(GMOCK_INCLUDES) \
|
|
|
|
-pthread
|
|
|
|
|
2017-08-19 21:12:06 +08:00
|
|
|
# Build unittests
|
|
|
|
GTEST_LIBS = libgtest.la libgtest_main.la
|
2018-06-02 06:42:37 +08:00
|
|
|
GMOCK_LIBS = libgmock.la libgmock_main.la
|
2018-04-26 03:33:14 +08:00
|
|
|
TESS_LIBS = $(top_builddir)/src/api/libtesseract.la
|
2018-08-27 17:44:46 +08:00
|
|
|
TRAINING_LIBS = $(top_builddir)/src/training/libtesseract_training.la
|
|
|
|
TRAINING_LIBS += $(top_builddir)/src/training/libtesseract_tessopt.la
|
|
|
|
TRAINING_LIBS += $(ICU_UC_LIBS)
|
2018-06-02 06:42:37 +08:00
|
|
|
AM_CPPFLAGS += -isystem $(top_srcdir)/googletest/googletest/include \
|
|
|
|
-isystem $(top_srcdir)/googletest/googlemock/include
|
2017-08-19 21:12:06 +08:00
|
|
|
|
|
|
|
check_PROGRAMS = \
|
|
|
|
apiexample_test \
|
2018-08-29 03:03:49 +08:00
|
|
|
applybox_test \
|
2018-08-25 16:28:22 +08:00
|
|
|
bitvector_test \
|
2018-08-25 17:07:32 +08:00
|
|
|
cleanapi_test \
|
2018-08-25 19:04:12 +08:00
|
|
|
colpartition_test \
|
2018-08-25 21:10:52 +08:00
|
|
|
denorm_test \
|
2018-08-26 00:07:56 +08:00
|
|
|
heap_test \
|
2018-08-26 00:08:30 +08:00
|
|
|
indexmapbidi_test \
|
2018-08-26 00:35:55 +08:00
|
|
|
intfeaturemap_test \
|
2017-09-08 22:06:19 +08:00
|
|
|
intsimdmatrix_test \
|
2018-08-26 21:23:42 +08:00
|
|
|
linlsq_test \
|
|
|
|
loadlang_test \
|
2018-03-04 21:52:27 +08:00
|
|
|
matrix_test \
|
2018-08-27 00:22:43 +08:00
|
|
|
nthitem_test \
|
2018-03-04 21:52:27 +08:00
|
|
|
osd_test \
|
2018-08-26 21:23:42 +08:00
|
|
|
progress_test \
|
2018-08-27 00:30:21 +08:00
|
|
|
rect_test \
|
2018-08-27 00:45:57 +08:00
|
|
|
stats_test \
|
2018-08-27 00:49:21 +08:00
|
|
|
tablefind_test \
|
2018-08-27 00:59:45 +08:00
|
|
|
tablerecog_test \
|
2018-08-27 01:02:01 +08:00
|
|
|
tabvector_test \
|
2018-08-27 01:04:54 +08:00
|
|
|
tfile_test \
|
2017-09-17 00:47:04 +08:00
|
|
|
tesseracttests
|
2018-03-04 21:52:27 +08:00
|
|
|
|
2018-08-27 17:44:46 +08:00
|
|
|
if ENABLE_TRAINING
|
2018-08-27 17:54:10 +08:00
|
|
|
check_PROGRAMS += commandlineflags_test
|
2018-08-27 17:44:46 +08:00
|
|
|
check_PROGRAMS += validator_test
|
|
|
|
endif
|
|
|
|
|
2017-08-19 21:12:06 +08:00
|
|
|
TESTS = $(check_PROGRAMS)
|
|
|
|
|
2018-08-25 16:28:22 +08:00
|
|
|
# List of source files needed to build the executable:
|
2018-03-04 21:43:28 +08:00
|
|
|
|
2017-09-08 22:06:19 +08:00
|
|
|
apiexample_test_SOURCES = apiexample_test.cc
|
2017-09-09 00:34:31 +08:00
|
|
|
apiexample_test_LDFLAGS = $(OPENCL_LDFLAGS) $(LEPTONICA_LIBS)
|
|
|
|
apiexample_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
|
2018-06-02 06:47:34 +08:00
|
|
|
|
2018-08-29 03:03:49 +08:00
|
|
|
applybox_test_SOURCES = applybox_test.cc
|
|
|
|
applybox_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-25 16:28:22 +08:00
|
|
|
bitvector_test_SOURCES = bitvector_test.cc
|
|
|
|
bitvector_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-25 17:07:32 +08:00
|
|
|
cleanapi_test_SOURCES = cleanapi_test.cc
|
|
|
|
cleanapi_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-25 19:04:12 +08:00
|
|
|
colpartition_test_SOURCES = colpartition_test.cc
|
|
|
|
colpartition_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-27 17:54:10 +08:00
|
|
|
commandlineflags_test_SOURCES = commandlineflags_test.cc
|
|
|
|
commandlineflags_test_LDADD = $(GTEST_LIBS) $(TRAINING_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-25 21:10:52 +08:00
|
|
|
denorm_test_SOURCES = denorm_test.cc
|
|
|
|
denorm_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-26 00:07:56 +08:00
|
|
|
heap_test_SOURCES = heap_test.cc
|
|
|
|
heap_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-26 00:08:30 +08:00
|
|
|
indexmapbidi_test_SOURCES = indexmapbidi_test.cc
|
|
|
|
indexmapbidi_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-26 00:35:55 +08:00
|
|
|
intfeaturemap_test_SOURCES = intfeaturemap_test.cc
|
|
|
|
intfeaturemap_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2017-09-08 22:06:19 +08:00
|
|
|
intsimdmatrix_test_SOURCES = intsimdmatrix_test.cc
|
2017-09-09 00:34:31 +08:00
|
|
|
intsimdmatrix_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
2017-08-19 21:12:06 +08:00
|
|
|
|
2018-08-26 21:23:42 +08:00
|
|
|
linlsq_test_SOURCES = linlsq_test.cc
|
|
|
|
linlsq_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
|
|
|
loadlang_test_SOURCES = loadlang_test.cc
|
|
|
|
loadlang_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
|
|
|
|
|
2017-08-19 21:12:06 +08:00
|
|
|
matrix_test_SOURCES = matrix_test.cc
|
2017-09-09 00:34:31 +08:00
|
|
|
matrix_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
2017-09-08 22:06:19 +08:00
|
|
|
|
2018-08-27 00:22:43 +08:00
|
|
|
nthitem_test_SOURCES = nthitem_test.cc
|
|
|
|
nthitem_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-03-04 21:52:27 +08:00
|
|
|
osd_test_SOURCES = osd_test.cc
|
|
|
|
osd_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
|
|
|
|
|
2018-08-26 21:23:42 +08:00
|
|
|
progress_test_SOURCES = progress_test.cc
|
|
|
|
progress_test_LDFLAGS = $(OPENCL_LDFLAGS) $(LEPTONICA_LIBS)
|
|
|
|
progress_test_LDADD = $(GTEST_LIBS) $(GMOCK_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
|
2018-06-17 13:31:32 +08:00
|
|
|
|
2018-08-27 00:30:21 +08:00
|
|
|
rect_test_SOURCES = rect_test.cc
|
|
|
|
rect_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-27 00:45:57 +08:00
|
|
|
stats_test_SOURCES = stats_test.cc
|
|
|
|
stats_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-27 00:49:21 +08:00
|
|
|
tablefind_test_SOURCES = tablefind_test.cc
|
|
|
|
tablefind_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-27 00:59:45 +08:00
|
|
|
tablerecog_test_SOURCES = tablerecog_test.cc
|
|
|
|
tablerecog_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-27 01:02:01 +08:00
|
|
|
tabvector_test_SOURCES = tabvector_test.cc
|
|
|
|
tabvector_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-27 17:44:46 +08:00
|
|
|
tesseracttests_SOURCES = ../tests/tesseracttests.cpp
|
|
|
|
tesseracttests_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
|
|
|
|
|
2018-08-27 01:04:54 +08:00
|
|
|
tfile_test_SOURCES = tfile_test.cc
|
|
|
|
tfile_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS)
|
|
|
|
|
2018-08-27 17:44:46 +08:00
|
|
|
validator_test_SOURCES = validator_test.cc
|
|
|
|
validator_test_LDADD = $(GTEST_LIBS) $(TRAINING_LIBS) $(TESS_LIBS)
|
2017-08-19 21:12:06 +08:00
|
|
|
|
|
|
|
# for windows
|
|
|
|
if T_WIN
|
|
|
|
apiexample_test_LDADD += -lws2_32
|
2017-09-08 22:06:19 +08:00
|
|
|
intsimdmatrix_test_LDADD += -lws2_32
|
2017-08-19 21:12:06 +08:00
|
|
|
matrix_test_LDADD += -lws2_32
|
2018-03-04 21:52:27 +08:00
|
|
|
osd_test_LDADD += -lws2_32
|
2018-06-17 13:31:32 +08:00
|
|
|
loadlang_test_LDADD += -lws2_32
|
2017-08-19 21:12:06 +08:00
|
|
|
tesseracttests_LDADD += -lws2_32
|
|
|
|
endif
|
2017-09-12 18:53:26 +08:00
|
|
|
|
2018-06-06 20:20:14 +08:00
|
|
|
EXTRA_apiexample_test_DEPENDENCIES = $(abs_top_builddir)/test/testing/phototest.tif
|
|
|
|
EXTRA_apiexample_test_DEPENDENCIES += $(abs_top_builddir)/test/testing/phototest.txt
|
2017-09-12 18:53:26 +08:00
|
|
|
|
2018-06-06 20:20:14 +08:00
|
|
|
$(abs_top_builddir)/test/testing/phototest.tif:
|
2018-06-09 20:14:37 +08:00
|
|
|
mkdir -p $(top_builddir)/test/testing
|
|
|
|
ln -s $(TESTING_DIR)/phototest.tif $(top_builddir)/test/testing/phototest.tif
|
2017-09-12 18:53:26 +08:00
|
|
|
|
2018-06-06 20:20:14 +08:00
|
|
|
$(abs_top_builddir)/test/testing/phototest.txt:
|
2018-06-09 20:14:37 +08:00
|
|
|
mkdir -p $(top_builddir)/test/testing
|
|
|
|
ln -s $(TESTING_DIR)/phototest.txt $(top_builddir)/test/testing/phototest.txt
|