Skip to content

Commit

Permalink
first try to integrate gtest poc with travis
Browse files Browse the repository at this point in the history
This is not intended to go into main source repo!
  • Loading branch information
ChristianBeer committed Apr 7, 2018
1 parent 8005b76 commit a29a998
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ matrix:
before_install:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( sudo apt-get -qq update ) fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( sudo apt-get install freeglut3-dev libxmu-dev libxi-dev libfcgi-dev libxss-dev libnotify-dev libxcb-util0-dev libsqlite3-dev libgtk2.0-dev libwebkitgtk-dev mingw-w64 binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 ) fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( pip install --user cpp-coveralls ) fi

before_script:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( ./_autosetup ) fi

script:
- if [[ "${BOINC_TYPE}" == "libs" ]]; then ( ./configure --disable-server --disable-client --disable-manager && make ) fi
- if [[ "${BOINC_TYPE}" == "libs" ]]; then ( ./configure --disable-server --disable-client --disable-manager && make && cd gtest && make -f Makefile.gtest && make -f Makefile.gtest test ) fi
- if [[ "${BOINC_TYPE}" == "server" ]]; then ( ./configure --disable-client --disable-manager && make ) fi
- if [[ "${BOINC_TYPE}" == "client" ]]; then ( ./configure --disable-server --disable-manager && make ) fi
- if [[ "${BOINC_TYPE}" == "apps" ]]; then ( ./configure --enable-apps --disable-server --disable-client --disable-manager && make ) fi
Expand Down
58 changes: 58 additions & 0 deletions 3rdParty/buildGoogletestLinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2017 University of California
#
# BOINC is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# BOINC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BOINC. If not, see <http://www.gnu.org/licenses/>.

# Script to build a wxWidgets GTK version for BOINC

# Usage:
# cd [path]/wxWidgets-3.0.2/
# source path_to_this_script [--clean] [--debug] [--prefix PATH]
#
# the --clean argument will force a full rebuild.
# the --debug argument will build the debug version of the library
# if --prefix is given as absolute path the library is installed into there

doclean=""
debug_flag=""
lprefix=""
cmdline_prefix=""
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-clean|--clean)
doclean="yes"
;;
-prefix|--prefix)
lprefix="$2"
cmdline_prefix="--prefix=${lprefix}"
shift
;;
esac
shift # past argument or value
done

cd googletest/make
make
if [ $? -ne 0 ]; then cd ..; return 1; fi
if [ "x${lprefix}" != "x" ]; then
(cp gtest_main.a ${lprefix}/lib && cp -r ../include/gtest ${lprefix}/include)
if [ $? -ne 0 ]; then cd ..; return 1; fi
fi

cd ../..
return 0
2 changes: 1 addition & 1 deletion 3rdParty/buildLinuxDependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ fi

#download_and_build $DIRNAME $FILENAME $DOWNLOADURL $BUILDSCRIPT
download_and_build "wxWidgets-3.0.2" "wxWidgets-3.0.2.tar.bz2" "https://sourceforge.net/projects/wxwindows/files/3.0.2/wxWidgets-3.0.2.tar.bz2" "${ROOTDIR}/3rdParty/buildWxLinux.sh ${wxoption}"

download_and_build "googletest-release-1.8.0" "release-1.8.0.tar.gz" "https://github.com/google/googletest/archive/release-1.8.0.tar.gz" "${ROOTDIR}/3rdParty/buildGoogletestLinux.sh"
# change back to root directory
cd ${ROOTDIR} || exit 1
6 changes: 3 additions & 3 deletions gtest/Makefile.gtest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Location of GTEST
GTEST_DIR = ../../googletest/googletest
GTEST_MAIN = ${GTEST_DIR}/make/gtest_main.a
GTEST_DIR = ../3rdParty/buildCache/linux
GTEST_MAIN = ${GTEST_DIR}/lib/gtest_main.a

# BOINC Libraries
BOINC_DIR = ..
Expand All @@ -14,7 +14,7 @@ OTHER_INC = -I /usr/include/mysql
CPPFLAGS = -isystem $(GTEST_DIR)/include ${BOINC_INC} ${OTHER_INC}

# Flags passed to the C++ compiler.
CXXFLAGS = -g -Wall -Wextra -Werror
CXXFLAGS = -g -Wall -Wextra -Werror --coverage

# Include all source files
#cppsrc = $(wildcard *.cpp) \
Expand Down
6 changes: 3 additions & 3 deletions gtest/lib/Makefile.gtest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Location of GTEST
GTEST_DIR = ../../../googletest/googletest
GTEST_MAIN = ${GTEST_DIR}/make/gtest_main.a
GTEST_DIR = ../../3rdParty/buildCache/linux
GTEST_MAIN = ${GTEST_DIR}/lib/gtest_main.a

# BOINC Libraries
BOINC_DIR = ../..
Expand All @@ -14,7 +14,7 @@ OTHER_INC = -I /usr/include/mysql
CPPFLAGS = -isystem $(GTEST_DIR)/include ${BOINC_INC} ${OTHER_INC}

# Flags passed to the C++ compiler.
CXXFLAGS = -g -Wall -Wextra -Werror
CXXFLAGS = -g -Wall -Wextra -Werror --coverage

# Include all source files
cppsrc = $(wildcard *.cpp)
Expand Down
6 changes: 3 additions & 3 deletions gtest/sched/Makefile.gtest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Location of GTEST
GTEST_DIR = ../../../googletest/googletest
GTEST_MAIN = ${GTEST_DIR}/make/gtest_main.a
GTEST_DIR = ../../3rdParty/buildCache/linux
GTEST_MAIN = ${GTEST_DIR}/lib/gtest_main.a

# BOINC Libraries
BOINC_DIR = ../..
Expand All @@ -14,7 +14,7 @@ OTHER_INC = -I /usr/include/mysql
CPPFLAGS = -isystem $(GTEST_DIR)/include ${BOINC_INC} ${OTHER_INC}

# Flags passed to the C++ compiler.
CXXFLAGS = -g -Wall -Wextra -Werror
CXXFLAGS = -g -Wall -Wextra -Werror --coverage

# Include all source files
cppsrc = $(wildcard *.cpp)
Expand Down

0 comments on commit a29a998

Please sign in to comment.