-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.unittest
68 lines (51 loc) · 2.29 KB
/
Dockerfile.unittest
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ubuntu
RUN apt-get update -y \
&& apt-get -y install \
git \
wget \
g++ \
xz-utils \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
ENV GTEST_DIR=./googletest/googletest
ENV GMOCK_DIR=./googletest/googlemock
RUN mkdir unittest
WORKDIR unittest
RUN git clone https://github.com/abseil/googletest.git
RUN g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
-isystem ${GMOCK_DIR}/include -I${GMOCK_DIR} \
-pthread -c ${GTEST_DIR}/src/gtest-all.cc &&\
g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
-isystem ${GMOCK_DIR}/include -I${GMOCK_DIR} \
-pthread -c ${GMOCK_DIR}/src/gmock-all.cc &&\
ar -rv libgmock.a gtest-all.o gmock-all.o
RUN wget http://downloads.arduino.cc/arduino-1.8.7-linux64.tar.xz &&\
tar xf arduino-1.8.7-linux64.tar.xz
COPY . .
RUN g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-isystem ./test/mocks \
-pthread -c ./test/mocks/Arduino.cpp
RUN g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-isystem ./test/mocks \
-pthread -c ./test/mocks/WString.cpp
RUN g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-isystem ./test/mocks \
-pthread -c ./makey.cpp
RUN g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-isystem ./test/mocks \
-pthread -c ./ethernetMaintainer.cpp
RUN g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-isystem ./test/mocks \
-pthread -c ./doorDisplay.cpp
RUN g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-isystem ./test/mocks \
-pthread -c ./test/makeyTests.cpp
RUN g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-isystem ./test/mocks \
-pthread -c ./test/EthernetMaintainerTests.cpp
RUN g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-isystem ./test/mocks \
-pthread -c ./test/DoorDisplayTests.cpp
RUN g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-isystem ./test/mocks \
-pthread Arduino.o WString.o makey.o ethernetMaintainer.o doorDisplay.o makeyTests.o EthernetMaintainerTests.o DoorDisplayTests.o libgmock.a ./test/tests.cpp -o tests
CMD ["./tests"]