Skip to content

Commit f7b5d00

Browse files
committed
#1: restore cmake variable and add a unit test
1 parent fcdc4c9 commit f7b5d00

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

build-in-docker.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
WORKSPACE=/workspace
2+
IMAGE=lifflander1/vt:wf-amd64-ubuntu-20.04-gcc-9-cuda-11.2.2-cpp
3+
4+
CMD='
5+
cd '$WORKSPACE'; \
6+
ls -l;
7+
chmod +x ./build.sh; \
8+
\
9+
export $(cat .env | egrep -v "(^#.*|^$)" | xargs) && ./build.sh'
10+
11+
docker run \
12+
--name test-container \
13+
-w $WORKSPACE \
14+
-v .:/workspace \
15+
-v /opt/foo/build:/opt/foo/build \
16+
-v /opt/foo/output:/opt/foo/output \
17+
-e CI="1" \
18+
-e https_proxy="" \
19+
-e http_proxy="" \
20+
$IMAGE \
21+
bash -c "$CMD"

cmake/turn_on_warnings.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if(NOT DEFINED FOO_WARNING_FLAGS)
3030
endif()
3131

3232
if (FOO_WERROR_ENABLED) # Treat warning as errors
33-
# add_cxx_compiler_flag_if_supported("-Werror")
33+
add_cxx_compiler_flag_if_supported("-Werror")
3434
endif()
3535
endif()
3636

tests/unit/foo/bar/bar_test.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <gtest/gtest.h>
2+
3+
#include "foo/bar/bar.h"
4+
5+
// Demonstrate some basic assertions.
6+
TEST(BarTest, BasicAssertions) {
7+
auto bar = foo::bar::Bar();
8+
auto n = bar.diff(5, 3);
9+
EXPECT_EQ(n, 2);
10+
}
File renamed without changes.

0 commit comments

Comments
 (0)