mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Import latest gtest to third_party to be able to use gmock
This commit is contained in:
@@ -6,7 +6,6 @@ version: 0.0.0.0.1-branch-{branch}-build-{build}
|
||||
clone_depth: 10
|
||||
cache:
|
||||
- c:\cygwin-setup-cache
|
||||
- c:\gtest-1.7.0
|
||||
environment:
|
||||
matrix:
|
||||
- cygwin_url: https://cygwin.com/setup-x86_64.exe
|
||||
@@ -21,20 +20,13 @@ install:
|
||||
- c:\cygwin-root\bin\sh -lc "cat /proc/meminfo"
|
||||
- c:\cygwin-root\bin\sh -lc "cygcheck -s -v > $APPVEYOR_BUILD_FOLDER/cygcheck.log 2>&1"
|
||||
- ps: Push-AppveyorArtifact cygcheck.log
|
||||
- ps: |
|
||||
if (Test-Path "c:\gtest-1.7.0\src\gtest-all.cc") {
|
||||
echo "using gtest from cache"
|
||||
} else {
|
||||
(New-Object Net.WebClient).DownloadFile('http://googletest.googlecode.com/files/gtest-1.7.0.zip', 'c:\gtest-1.7.0.zip')
|
||||
7z x -oc:\ c:\gtest-1.7.0.zip
|
||||
}
|
||||
- c:\cygwin-root\bin\sh -lc "/bin/easy_install* pexpect"
|
||||
# stdin is broken at AppVeyor, so we open it explicitly as /dev/null
|
||||
build_script:
|
||||
- git submodule update --init
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER; ./autogen.sh < /dev/null"
|
||||
- mkdir build
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; ../configure --enable-charset --enable-zlib --enable-openssl --enable-perl --enable-python --enable-cyrus --with-gtest=/cygdrive/c/gtest-1.7.0 < /dev/null"
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; ../configure --enable-charset --enable-zlib --enable-openssl --enable-perl --enable-python --enable-cyrus < /dev/null"
|
||||
- ps: Push-AppveyorArtifact build\config.log
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 -j2 < /dev/null"
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make install < /dev/null"
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "Csocket"]
|
||||
path = third_party/Csocket
|
||||
url = https://github.com/jimloco/Csocket.git
|
||||
[submodule "third_party/googletest"]
|
||||
path = third_party/googletest
|
||||
url = https://github.com/google/googletest
|
||||
|
||||
@@ -38,14 +38,13 @@ before_install:
|
||||
install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cat /proc/cpuinfo /proc/meminfo; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then lsb_release -a; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi # for gcc-4.8
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:teward/swig3.0; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:teward/icu-backports; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libperl-dev python3-dev tcl-dev libsasl2-dev libgtest-dev libicu-dev swig3.0 doxygen graphviz python3-setuptools socat; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install g++-4.8; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libperl-dev python3-dev tcl-dev libsasl2-dev libicu-dev swig3.0 doxygen graphviz python3-setuptools socat; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install g++-4.8; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CFGFLAGS="$CFGFLAGS --with-gtest=/usr/src/gtest"; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo easy_install3 pexpect; fi
|
||||
- |
|
||||
if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD_TYPE" == "coverage" ]]; then
|
||||
|
||||
35
Makefile.in
35
Makefile.in
@@ -31,12 +31,13 @@ INSTALL_DATA := @INSTALL_DATA@
|
||||
GIT := @GIT@
|
||||
SED := @SED@
|
||||
|
||||
GTEST_DOWNLOAD :=
|
||||
GTEST_DIR := @GTEST_DIR@
|
||||
GMOCK_DIR := @GMOCK_DIR@
|
||||
ifeq "$(GTEST_DIR)" ""
|
||||
GTEST_VER := 1.7.0
|
||||
GTEST_DIR := test/gtest-$(GTEST_VER)
|
||||
GTEST_DOWNLOAD := 1
|
||||
GTEST_DIR := $(srcdir)/third_party/googletest/googletest
|
||||
endif
|
||||
ifeq "$(GMOCK_DIR)" ""
|
||||
GMOCK_DIR := $(srcdir)/third_party/googletest/googlemock
|
||||
endif
|
||||
|
||||
LIB_SRCS := ZNCString.cpp Csocket.cpp znc.cpp IRCNetwork.cpp User.cpp IRCSock.cpp \
|
||||
@@ -95,9 +96,9 @@ $(LIBZNC): $(LIB_OBJS)
|
||||
$(Q)$(CXX) $(LDFLAGS) -shared -o $@ $(LIB_OBJS) $(LIBS) -Wl,--out-implib=libznc.dll.a
|
||||
endif
|
||||
|
||||
unittest: $(LIB_OBJS) test/gtest-all.o test/gtest-main.o $(TESTS)
|
||||
unittest: $(LIB_OBJS) test/gtest-all.o test/gmock-all.o test/gmock-main.o $(TESTS)
|
||||
$(E) Linking unit test...
|
||||
$(Q)$(CXX) $(LDFLAGS) -o $@ $(LIB_OBJS) test/gtest-all.o test/gtest-main.o $(TESTS) $(LIBS)
|
||||
$(Q)$(CXX) $(LDFLAGS) -o $@ $(LIB_OBJS) test/gtest-all.o test/gmock-all.o test/gmock-main.o $(TESTS) $(LIBS)
|
||||
|
||||
man:
|
||||
@$(MAKE) -C man $(C)
|
||||
@@ -121,30 +122,22 @@ src/%.o: src/%.cpp Makefile include/znc/Csocket.h
|
||||
test/%.o: test/%.cpp Makefile include/znc/Csocket.h
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object $*...
|
||||
$(Q)$(CXX) $(CXXFLAGS) -I$(GTEST_DIR)/include -c -o $@ $< -MD -MF .depend/$*.test.dep -MT $@
|
||||
$(Q)$(CXX) $(CXXFLAGS) -I$(GMOCK_DIR)/include -I$(GTEST_DIR)/include -c -o $@ $< -MD -MF .depend/$*.test.dep -MT $@
|
||||
|
||||
test/gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object gtest-all...
|
||||
$(Q)$(CXX) $(CXXFLAGS) -I$(GTEST_DIR)/include -I$(GTEST_DIR) -c -o $@ $< -MD -MF .depend/gtest-all.dep -MT $@
|
||||
|
||||
test/gtest-main.o: $(GTEST_DIR)/src/gtest_main.cc Makefile
|
||||
test/gmock-all.o: $(GMOCK_DIR)/src/gmock-all.cc Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object gtest-main...
|
||||
$(Q)$(CXX) $(CXXFLAGS) -I$(GTEST_DIR)/include -c -o $@ $< -MD -MF .depend/gtest-main.dep -MT $@
|
||||
$(E) Building test object gmock-all...
|
||||
$(Q)$(CXX) $(CXXFLAGS) -I$(GMOCK_DIR)/include -I$(GTEST_DIR)/include -I$(GMOCK_DIR) -c -o $@ $< -MD -MF .depend/gmock-all.dep -MT $@
|
||||
|
||||
ifneq "$(GTEST_DOWNLOAD)" ""
|
||||
test/gtest.zip:
|
||||
test/gmock-main.o: $(GMOCK_DIR)/src/gmock_main.cc Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Downloading GoogleTest $(GTEST_VER)
|
||||
$(Q)wget http://googletest.googlecode.com/files/gtest-$(GTEST_VER).zip -O $@
|
||||
|
||||
$(GTEST_DIR)/src/gtest-all.cc $(GTEST_DIR)/src/gtest_main.cc $(GTEST_DIR)/include/gtest/gtest.h: test/gtest.zip
|
||||
$(E) Unpacking GoogleTest $(GTEST_VER)
|
||||
$(Q)test -r $@ || unzip $^ -d test/
|
||||
$(Q)test -r $@
|
||||
$(Q)touch -c $@
|
||||
endif
|
||||
$(E) Building test object gmock-main...
|
||||
$(Q)$(CXX) $(CXXFLAGS) -I$(GMOCK_DIR)/include -I$(GTEST_DIR)/include -c -o $@ $< -MD -MF .depend/gmock-main.dep -MT $@
|
||||
|
||||
ifneq "THIS_IS_NOT_TARBALL" ""
|
||||
# If git commit was changed since previous build, add a phony target to dependencies, forcing version.o to be recompiled
|
||||
|
||||
20
configure.ac
20
configure.ac
@@ -134,9 +134,22 @@ AC_ARG_ENABLE( [poll],
|
||||
AS_HELP_STRING([--disable-poll], [use select() instead of poll()]),
|
||||
[POLL="$enableval"],
|
||||
[POLL="yes"])
|
||||
|
||||
AC_ARG_WITH( [gtest],
|
||||
AS_HELP_STRING([--with-gtest=DIR], [Path to directory with src/gtest-all.cc and src/gtest_main.cc files.
|
||||
If not specified, "make test" will download gtest tarball and use it.]))
|
||||
AS_HELP_STRING([--with-gtest=DIR], [Path to directory with src/gtest-all.cc file.
|
||||
If not specified, git submodule will be used.
|
||||
If it is not available either, "make test" will fail.]))
|
||||
if test "x$with_gtest" != xno; then
|
||||
AC_SUBST([GTEST_DIR], [$with_gtest])
|
||||
fi
|
||||
AC_ARG_WITH([gmock],
|
||||
AS_HELP_STRING([--with-gmock=DIR], [Path to directory with src/gmock-all.cc and src/gmock_main.cc files.
|
||||
If not specified, git submodule will be used.
|
||||
If it is not available either, "make test" will fail.]))
|
||||
if test "x$with_gmock" != xno; then
|
||||
AC_SUBST([GMOCK_DIR], [$with_gmock])
|
||||
fi
|
||||
|
||||
|
||||
AC_ARG_WITH([systemdsystemunitdir],
|
||||
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
|
||||
@@ -145,9 +158,6 @@ AC_ARG_WITH([systemdsystemunitdir],
|
||||
with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
|
||||
fi
|
||||
])
|
||||
if test "x$with_gtest" != xno; then
|
||||
AC_SUBST([GTEST_DIR], [$with_gtest])
|
||||
fi
|
||||
if test "x$with_systemdsystemunitdir" != xno; then
|
||||
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||
fi
|
||||
|
||||
1
third_party/googletest
vendored
Submodule
1
third_party/googletest
vendored
Submodule
Submodule third_party/googletest added at f570b27e15
Reference in New Issue
Block a user