From 7058bbf282cfa2c239bd7bdd516756ddd270ddc0 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 31 Oct 2021 19:37:17 +0100 Subject: [PATCH] Move googletest to unittest/third_party/googletest Signed-off-by: Stefan Weil --- .gitmodules | 2 +- CMakeLists.txt | 4 ++-- Makefile.am | 24 ++++++++++--------- sw.cpp | 1 + unittest/README.md | 2 +- googletest => unittest/third_party/googletest | 0 6 files changed, 18 insertions(+), 15 deletions(-) rename googletest => unittest/third_party/googletest (100%) diff --git a/.gitmodules b/.gitmodules index d64de322..7d15927d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "googletest"] - path = googletest + path = unittest/third_party/googletest url = https://github.com/google/googletest.git [submodule "test"] path = test diff --git a/CMakeLists.txt b/CMakeLists.txt index af8a8acb..eb28afae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -748,8 +748,8 @@ endif() ######################################## -if (BUILD_TESTS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/googletest/CMakeLists.txt) - add_subdirectory(googletest) +if (BUILD_TESTS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/unittest/third_party/googletest/CMakeLists.txt) + add_subdirectory(unittest/third_party/googletest) endif() if (BUILD_TRAINING_TOOLS) diff --git a/Makefile.am b/Makefile.am index b5cb5083..16a18a0d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1160,20 +1160,22 @@ endif # TENSORFLOW # Build googletest: check_LTLIBRARIES = libgtest.la libgtest_main.la libgmock.la libgmock_main.la -libgtest_la_SOURCES = googletest/googletest/src/gtest-all.cc -libgtest_la_CPPFLAGS = -I$(top_srcdir)/googletest/googletest/include -I$(top_srcdir)/googletest/googletest -pthread -libgtest_main_la_SOURCES = googletest/googletest/src/gtest_main.cc +libgtest_la_SOURCES = unittest/third_party/googletest/googletest/src/gtest-all.cc +libgtest_la_CPPFLAGS = -I$(top_srcdir)/unittest/third_party/googletest/googletest/include +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) -GMOCK_INCLUDES = -I$(top_srcdir)/googletest/googlemock/include \ - -I$(top_srcdir)/googletest/googlemock \ - -I$(top_srcdir)/googletest/googletest/include \ - -I$(top_srcdir)/googletest/googletest +GMOCK_INCLUDES = -I$(top_srcdir)/unittest/third_party/googletest/googlemock/include \ + -I$(top_srcdir)/unittest/third_party/googletest/googlemock \ + -I$(top_srcdir)/unittest/third_party/googletest/googletest/include \ + -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) \ -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) \ -pthread @@ -1185,8 +1187,8 @@ TESS_LIBS += libtesseract.la $(libarchive_LIBS) TESS_LIBS += $(TENSORFLOW_LIBS) TRAINING_LIBS = libtesseract_training.la TRAINING_LIBS += $(TESS_LIBS) -unittest_CPPFLAGS += -isystem $(top_srcdir)/googletest/googletest/include -unittest_CPPFLAGS += -isystem $(top_srcdir)/googletest/googlemock/include +unittest_CPPFLAGS += -isystem $(top_srcdir)/unittest/third_party/googletest/googletest/include +unittest_CPPFLAGS += -isystem $(top_srcdir)/unittest/third_party/googletest/googlemock/include check_PROGRAMS = apiexample_test if ENABLE_TRAINING diff --git a/sw.cpp b/sw.cpp index 7e687661..05dc89c0 100644 --- a/sw.cpp +++ b/sw.cpp @@ -323,6 +323,7 @@ void build(Solution &s) auto &tw = add_test("tatweel"); tw += "unittest/util/.*"_rr; tw += "unittest/third_party/.*"_rr; + tw -= "unittest/third_party/googletest/.*"_rr; } } diff --git a/unittest/README.md b/unittest/README.md index 39153923..02303b04 100644 --- a/unittest/README.md +++ b/unittest/README.md @@ -60,10 +60,10 @@ │   └── script │   └── Latin.traineddata └── tesseract - ├── googletest ... ├── test ├── unittest + │   └── third_party/googletest └── VERSION ``` diff --git a/googletest b/unittest/third_party/googletest similarity index 100% rename from googletest rename to unittest/third_party/googletest