Move googletest to unittest/third_party/googletest

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2021-10-31 19:37:17 +01:00
parent a5f2f90c8d
commit 7058bbf282
6 changed files with 18 additions and 15 deletions

2
.gitmodules vendored
View File

@ -1,5 +1,5 @@
[submodule "googletest"] [submodule "googletest"]
path = googletest path = unittest/third_party/googletest
url = https://github.com/google/googletest.git url = https://github.com/google/googletest.git
[submodule "test"] [submodule "test"]
path = test path = test

View File

@ -748,8 +748,8 @@ endif()
######################################## ########################################
if (BUILD_TESTS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/googletest/CMakeLists.txt) if (BUILD_TESTS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/unittest/third_party/googletest/CMakeLists.txt)
add_subdirectory(googletest) add_subdirectory(unittest/third_party/googletest)
endif() endif()
if (BUILD_TRAINING_TOOLS) if (BUILD_TRAINING_TOOLS)

View File

@ -1160,20 +1160,22 @@ endif # TENSORFLOW
# Build googletest: # Build googletest:
check_LTLIBRARIES = libgtest.la libgtest_main.la libgmock.la libgmock_main.la check_LTLIBRARIES = libgtest.la libgtest_main.la libgmock.la libgmock_main.la
libgtest_la_SOURCES = googletest/googletest/src/gtest-all.cc libgtest_la_SOURCES = unittest/third_party/googletest/googletest/src/gtest-all.cc
libgtest_la_CPPFLAGS = -I$(top_srcdir)/googletest/googletest/include -I$(top_srcdir)/googletest/googletest -pthread libgtest_la_CPPFLAGS = -I$(top_srcdir)/unittest/third_party/googletest/googletest/include
libgtest_main_la_SOURCES = googletest/googletest/src/gtest_main.cc libgtest_la_CPPFLAGS += -I$(top_srcdir)/unittest/third_party/googletest/googletest
libgtest_la_CPPFLAGS += -pthread
libgtest_main_la_SOURCES = unittest/third_party/googletest/googletest/src/gtest_main.cc
libgtest_main_la_CPPFLAGS = $(libgtest_la_CPPFLAGS) libgtest_main_la_CPPFLAGS = $(libgtest_la_CPPFLAGS)
GMOCK_INCLUDES = -I$(top_srcdir)/googletest/googlemock/include \ GMOCK_INCLUDES = -I$(top_srcdir)/unittest/third_party/googletest/googlemock/include \
-I$(top_srcdir)/googletest/googlemock \ -I$(top_srcdir)/unittest/third_party/googletest/googlemock \
-I$(top_srcdir)/googletest/googletest/include \ -I$(top_srcdir)/unittest/third_party/googletest/googletest/include \
-I$(top_srcdir)/googletest/googletest -I$(top_srcdir)/unittest/third_party/googletest/googletest
libgmock_la_SOURCES = googletest/googlemock/src/gmock-all.cc libgmock_la_SOURCES = unittest/third_party/googletest/googlemock/src/gmock-all.cc
libgmock_la_CPPFLAGS = $(GMOCK_INCLUDES) \ libgmock_la_CPPFLAGS = $(GMOCK_INCLUDES) \
-pthread -pthread
libgmock_main_la_SOURCES = googletest/googlemock/src/gmock_main.cc libgmock_main_la_SOURCES = unittest/third_party/googletest/googlemock/src/gmock_main.cc
libgmock_main_la_CPPFLAGS = $(GMOCK_INCLUDES) \ libgmock_main_la_CPPFLAGS = $(GMOCK_INCLUDES) \
-pthread -pthread
@ -1185,8 +1187,8 @@ TESS_LIBS += libtesseract.la $(libarchive_LIBS)
TESS_LIBS += $(TENSORFLOW_LIBS) TESS_LIBS += $(TENSORFLOW_LIBS)
TRAINING_LIBS = libtesseract_training.la TRAINING_LIBS = libtesseract_training.la
TRAINING_LIBS += $(TESS_LIBS) TRAINING_LIBS += $(TESS_LIBS)
unittest_CPPFLAGS += -isystem $(top_srcdir)/googletest/googletest/include unittest_CPPFLAGS += -isystem $(top_srcdir)/unittest/third_party/googletest/googletest/include
unittest_CPPFLAGS += -isystem $(top_srcdir)/googletest/googlemock/include unittest_CPPFLAGS += -isystem $(top_srcdir)/unittest/third_party/googletest/googlemock/include
check_PROGRAMS = apiexample_test check_PROGRAMS = apiexample_test
if ENABLE_TRAINING if ENABLE_TRAINING

1
sw.cpp
View File

@ -323,6 +323,7 @@ void build(Solution &s)
auto &tw = add_test("tatweel"); auto &tw = add_test("tatweel");
tw += "unittest/util/.*"_rr; tw += "unittest/util/.*"_rr;
tw += "unittest/third_party/.*"_rr; tw += "unittest/third_party/.*"_rr;
tw -= "unittest/third_party/googletest/.*"_rr;
} }
} }

View File

@ -60,10 +60,10 @@
│   └── script │   └── script
│   └── Latin.traineddata │   └── Latin.traineddata
└── tesseract └── tesseract
├── googletest
... ...
├── test ├── test
├── unittest ├── unittest
│   └── third_party/googletest
└── VERSION └── VERSION
``` ```