Skip to content

Commit

Permalink
Move googletest to unittest/third_party/googletest
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Nov 1, 2021
1 parent a5f2f90 commit 7058bbf
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[submodule "googletest"]
path = googletest
path = unittest/third_party/googletest
url = https://github.com/google/googletest.git
[submodule "test"]
path = test
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 13 additions & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions sw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion unittest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
│   └── script
│   └── Latin.traineddata
└── tesseract
├── googletest
...
├── test
├── unittest
│   └── third_party/googletest
└── VERSION
```

Expand Down

0 comments on commit 7058bbf

Please sign in to comment.