File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ RUN set -xe && \
63
63
/update/bosque && \
64
64
rm -rf /var/lib/apt/lists/* /tmp/*
65
65
66
+ # Google Test
67
+ RUN set -xe && \
68
+ apt-get update -o Acquire::Check-Valid-Until=false && \
69
+ apt-get install -y --no-install-recommends libgtest-dev && \
70
+ rm -rf /var/lib/apt/lists/*
71
+
66
72
COPY cron /etc/cron.d
67
73
RUN set -xe && \
68
74
apt-get update -o Acquire::Check-Valid-Until=false && \
@@ -74,4 +80,4 @@ COPY docker-entrypoint.sh /
74
80
ENTRYPOINT ["/docker-entrypoint.sh" ]
75
81
76
82
LABEL maintainer="Herman Zvonimir Došilović <hermanz.dosilovic@gmail.com>"
77
- LABEL version="1.3 .0-extra"
83
+ LABEL version="1.4 .0-extra"
Original file line number Diff line number Diff line change
1
+ VERSIONS =" 8.4.0"
2
+ NAME =" C++ Test (GCC $VERSION, Google Test 1.8.1)"
3
+ SOURCE_FILE =" main.cpp"
4
+ BINARY_FILE =" a.out"
5
+ COMPILE_CMD =" /usr/bin/g++ $ARGS $SOURCE_FILE -lgtest -lgtest_main -lpthread "
6
+ RUN_CMD =" ./$BINARY_FILE $ARGS"
7
+ RUN_CMD_ISOLATE =" GTEST_COLOR=no ./$BINARY_FILE $ARGS"
Original file line number Diff line number Diff line change
1
+ #include < gtest/gtest.h>
2
+
3
+ int add (int x, int y) {
4
+ return x + y;
5
+ }
6
+
7
+ TEST (AdditionTest, NeutralElement) {
8
+ EXPECT_EQ (1 , add (1 , 0 ));
9
+ EXPECT_EQ (1 , add (0 , 1 ));
10
+ EXPECT_EQ (0 , add (0 , 0 ));
11
+ }
12
+
13
+ TEST (AdditionTest, CommutativeProperty) {
14
+ EXPECT_EQ (add (2 , 3 ), add (3 , 2 ));
15
+ }
16
+
17
+ int main (int argc, char **argv) {
18
+ ::testing::InitGoogleTest (&argc, argv);
19
+ return RUN_ALL_TESTS ();
20
+ }
You can’t perform that action at this time.
0 commit comments