Skip to content

Commit

Permalink
Support new Debian version of gmock and add testing for debian systems (
Browse files Browse the repository at this point in the history
  • Loading branch information
jspricke authored and SirVer committed May 4, 2017
1 parent 6d2feaa commit 12b3cc0
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 10 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ cache:
- /home/travis/docker/

env:
- UBUNTU_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=trusty DOCKER_CACHE_FILE=/home/travis/docker/trusty-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

install: true
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
25 changes: 25 additions & 0 deletions Dockerfile.jessie
Original file line number Diff line number Diff line change
@@ -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 changes: 25 additions & 0 deletions Dockerfile.stretch
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Dockerfile.xenial
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

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/*

COPY scripts/install_debs.sh cartographer/scripts/
Expand Down
11 changes: 6 additions & 5 deletions cmake/modules/FindGMock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ list(APPEND GMOCK_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS})
if(NOT GMOCK_LIBRARIES)
# If no system-wide gmock found, then find src version.
# Ubuntu might have this.
find_path(GMOCK_SRC_DIR gmock/CMakeLists.txt
find_path(GMOCK_SRC_DIR src/gmock.cc
HINTS
ENV GMOCK_DIR
PATH_SUFFIXES src
PATHS
/usr
/usr/src/googletest/googlemock
/usr/src/gmock
)
if(GMOCK_SRC_DIR)
# If src version found, build it.
add_subdirectory(${GMOCK_SRC_DIR}/gmock "${CMAKE_CURRENT_BINARY_DIR}/gmock")
set(GMOCK_INCLUDE_DIRS "${GMOCK_SRC_DIR}/gmock/gtest/include")
add_subdirectory(${GMOCK_SRC_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock")
# The next line is needed for Ubuntu Trusty.
set(GMOCK_INCLUDE_DIRS "${GMOCK_SRC_DIR}/gtest/include")
set(GMOCK_LIBRARIES gmock_main)
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion scripts/save_docker_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ set -o pipefail
if [[ ${TRAVIS_BRANCH} == "master" ]] &&
[[ ${TRAVIS_PULL_REQUEST} == "false" ]]; then
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};
fi

0 comments on commit 12b3cc0

Please sign in to comment.