Support new Debian version of gmock and add testing for debian systems (#236)

master
Jochen Sprickerhof 2017-05-04 12:47:12 +02:00 committed by Holger Rapp
parent 6d2feaa8c7
commit 12b3cc0d7b
6 changed files with 63 additions and 10 deletions

View File

@ -22,12 +22,14 @@ cache:
- /home/travis/docker/ - /home/travis/docker/
env: env:
- UBUNTU_RELEASE=trusty DOCKER_CACHE_FILE=/home/travis/docker/trusty-cache.tar.gz - LSB_RELEASE=trusty DOCKER_CACHE_FILE=/home/travis/docker/trusty-cache.tar.gz
- UBUNTU_RELEASE=xenial DOCKER_CACHE_FILE=/home/travis/docker/xenial-cache.tar.gz - LSB_RELEASE=xenial DOCKER_CACHE_FILE=/home/travis/docker/xenial-cache.tar.gz
- LSB_RELEASE=jessie DOCKER_CACHE_FILE=/home/travis/docker/jessie-cache.tar.gz
- LSB_RELEASE=stretch DOCKER_CACHE_FILE=/home/travis/docker/stretch-cache.tar.gz
before_install: scripts/load_docker_cache.sh before_install: scripts/load_docker_cache.sh
install: true install: true
script: script:
- docker build ${TRAVIS_BUILD_DIR} -t cartographer:${UBUNTU_RELEASE} -f Dockerfile.${UBUNTU_RELEASE} - docker build ${TRAVIS_BUILD_DIR} -t cartographer:${LSB_RELEASE} -f Dockerfile.${LSB_RELEASE}
- scripts/save_docker_cache.sh - scripts/save_docker_cache.sh

25
Dockerfile.jessie Normal file
View File

@ -0,0 +1,25 @@
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:jessie
# This base image doesn't ship with sudo.
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
COPY scripts/install_debs.sh cartographer/scripts/
RUN cartographer/scripts/install_debs.sh && rm -rf /var/lib/apt/lists/*
COPY scripts/install_ceres.sh cartographer/scripts/
RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver
COPY . cartographer
RUN cartographer/scripts/install_cartographer.sh && rm -rf cartographer

25
Dockerfile.stretch Normal file
View File

@ -0,0 +1,25 @@
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:stretch
# This base image doesn't ship with sudo.
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
COPY scripts/install_debs.sh cartographer/scripts/
RUN cartographer/scripts/install_debs.sh && rm -rf /var/lib/apt/lists/*
COPY scripts/install_ceres.sh cartographer/scripts/
RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver
COPY . cartographer
RUN cartographer/scripts/install_cartographer.sh && rm -rf cartographer

View File

@ -14,7 +14,7 @@
FROM ubuntu:xenial FROM ubuntu:xenial
# Xenial's base image doesn't ship with sudo. # This base image doesn't ship with sudo.
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
COPY scripts/install_debs.sh cartographer/scripts/ COPY scripts/install_debs.sh cartographer/scripts/

View File

@ -43,17 +43,18 @@ list(APPEND GMOCK_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS})
if(NOT GMOCK_LIBRARIES) if(NOT GMOCK_LIBRARIES)
# If no system-wide gmock found, then find src version. # If no system-wide gmock found, then find src version.
# Ubuntu might have this. # Ubuntu might have this.
find_path(GMOCK_SRC_DIR gmock/CMakeLists.txt find_path(GMOCK_SRC_DIR src/gmock.cc
HINTS HINTS
ENV GMOCK_DIR ENV GMOCK_DIR
PATH_SUFFIXES src
PATHS PATHS
/usr /usr/src/googletest/googlemock
/usr/src/gmock
) )
if(GMOCK_SRC_DIR) if(GMOCK_SRC_DIR)
# If src version found, build it. # If src version found, build it.
add_subdirectory(${GMOCK_SRC_DIR}/gmock "${CMAKE_CURRENT_BINARY_DIR}/gmock") add_subdirectory(${GMOCK_SRC_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock")
set(GMOCK_INCLUDE_DIRS "${GMOCK_SRC_DIR}/gmock/gtest/include") # The next line is needed for Ubuntu Trusty.
set(GMOCK_INCLUDE_DIRS "${GMOCK_SRC_DIR}/gtest/include")
set(GMOCK_LIBRARIES gmock_main) set(GMOCK_LIBRARIES gmock_main)
endif() endif()
endif() endif()

View File

@ -24,6 +24,6 @@ set -o pipefail
if [[ ${TRAVIS_BRANCH} == "master" ]] && if [[ ${TRAVIS_BRANCH} == "master" ]] &&
[[ ${TRAVIS_PULL_REQUEST} == "false" ]]; then [[ ${TRAVIS_PULL_REQUEST} == "false" ]]; then
mkdir -p $(dirname ${DOCKER_CACHE_FILE}); mkdir -p $(dirname ${DOCKER_CACHE_FILE});
docker save $(docker history -q cartographer:${UBUNTU_RELEASE} | docker save $(docker history -q cartographer:${LSB_RELEASE} |
grep -v '<missing>') | gzip > ${DOCKER_CACHE_FILE}; grep -v '<missing>') | gzip > ${DOCKER_CACHE_FILE};
fi fi