forked from ChicoState/UnitTestPractice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (31 loc) · 876 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM ubuntu:xenial
MAINTAINER Kevin Buffardi ([email protected])
LABEL title="Unit Testing CPP"
LABEL version=0.1
ENV GTEST_REPO=/googletest
ENV GTEST_DIR=${GTEST_REPO}/googletest
ENV CXXFLAGS=-std=c++11
ENV WORKDIR=/usr/src
WORKDIR /usr/src
COPY . ${WORKDIR}
# Install dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
build-essential \
g++ \
cmake \
git-all \
dos2unix
# Setup GoogleTest
RUN git clone https://github.com/google/googletest ${GTEST_REPO} && \
mkdir ${GTEST_REPO}/build && \
cd ${GTEST_REPO}/build && \
cmake .. -DBUILD_GMOCK=OFF && \
make && \
make install && \
cd ${WORKDIR}
# Assure Unix linefeed in shell command
RUN dos2unix test_runner.sh --safe --quiet
# Build and run tests
CMD sh -c ${WORKDIR}/test_runner.sh