Skip to content

Commit

Permalink
Remove local googletest submodule and link with system gtest (sonic-n…
Browse files Browse the repository at this point in the history
…et#245)

* Remove local googletest
* Link with system gtest
* Fix Makefile.am
  • Loading branch information
qiluo-msft authored Nov 5, 2018
1 parent b56ffba commit 0ee636b
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 61 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "googletest"]
path = googletest
url = https://github.com/google/googletest.git
6 changes: 1 addition & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
SUBDIRS = common pyext
SUBDIRS = common pyext tests

ACLOCAL_AMFLAGS = -I m4

if GTEST
SUBDIRS += tests
endif
31 changes: 0 additions & 31 deletions ThirdPartyLicenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,3 @@ reserves all other rights not expressly granted, whether by implication, estoppe
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
2. gtest/gtest.h imported from https://code.google.com/p/googletest/

/* Copyright 2008, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
*/
9 changes: 0 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ AC_ARG_ENABLE(debug,
esac],[debug=false])
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)

AC_ARG_ENABLE(gtest,
[ --enable-gtest Compile with googletest flags],
[case "${enableval}" in
yes) gtest=true ;;
no) gtest=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gtest) ;;
esac],[gtest=false])
AM_CONDITIONAL(GTEST, test x$gtest = xtrue)

AC_PATH_PROG(SWIG, [swig3.0])

CFLAGS_COMMON=""
Expand Down
8 changes: 0 additions & 8 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,12 @@ include /usr/share/dpkg/default.mk
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
override_dh_auto_configure:
bash -c 'mkdir -p googletest/build && cd $$_ && cmake ..'
dh_auto_configure -- --enable-gtest

override_dh_auto_build:
cd googletest/build && cmake --build .; cd -
dh_auto_build

override_dh_auto_install:
dh_auto_install

override_dh_clean:
dh_clean
rm -rf googletest/build
rm -f pyext/swsscommon.py pyext/swsscommon_wrap.cpp

override_dh_strip:
Expand Down
1 change: 0 additions & 1 deletion googletest
Submodule googletest deleted from ec44c6
6 changes: 2 additions & 4 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ else
DBGFLAGS = -g -DNDEBUG
endif

CFLAGS_GTEST = -I $(top_srcdir)/googletest/googletest/include
LDADD_GTEST = $(top_srcdir)/googletest/build/googlemock/gtest/libgtest_main.a \
$(top_srcdir)/googletest/build/googlemock/gtest/libgtest.a
CFLAGS_GTEST =
LDADD_GTEST = -L/usr/src/gtest -lgtest -lgtest_main

tests_SOURCES = redis_ut.cpp \
redis_piped_ut.cpp \
Expand All @@ -31,4 +30,3 @@ tests_SOURCES = redis_ut.cpp \
tests_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(LIBNL_CFLAGS)
tests_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(LIBNL_CFLAGS)
tests_LDADD = $(LDADD_GTEST) -lpthread -L$(top_srcdir)/common -lswsscommon $(LIBNL_LIBS)

0 comments on commit 0ee636b

Please sign in to comment.