Skip to content

Commit

Permalink
Added docker container. Prototype, under construction
Browse files Browse the repository at this point in the history
  • Loading branch information
jwgrenning committed Sep 20, 2017
1 parent 6df7dba commit b0336af
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CppUTestCompileFlags.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@

CPPUTEST_WARNINGFLAGS += -Wall
CPPUTEST_WARNINGFLAGS += -Werror
CPPUTEST_WARNINGFLAGS += -Wswitch-default
# Figure out how to ask if gcc7 vs clang, gcc7 only right now
ifeq "0" "1"
CPPUTEST_WARNINGFLAGS += -Wno-unknown-warning-option
CPPUTEST_WARNINGFLAGS += -Wno-covered-switch-default
CPPUTEST_WARNINGFLAGS += -Wno-reserved-id-macro
CPPUTEST_WARNINGFLAGS += -Wno-keyword-macro
CPPUTEST_WARNINGFLAGS += -Wno-documentation
endif

CPPUTEST_WARNINGFLAGS += -Wall
CPPUTEST_WARNINGFLAGS += -Werror
CPPUTEST_WARNINGFLAGS += -Wswitch-default
CPPUTEST_WARNINGFLAGS += -Wno-format-nonliteral
CPPUTEST_WARNINGFLAGS += -Wno-sign-conversion
CPPUTEST_WARNINGFLAGS += -Wno-pedantic
Expand Down
9 changes: 9 additions & 0 deletions Dockerfiles/cpputest3_8.gcc7
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM gcc:7

ENV CPPUTEST_HOME=/usr/src/cpputest

ADD cpputest /usr/src/cpputest

WORKDIR /usr/src/cpputest

RUN ./autogen.sh && ./configure && make tdd
27 changes: 27 additions & 0 deletions Dockerfiles/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
!!!! Under construction !!!!


Define the host system directory to mount and the container working directory
```
MOUNT_DIR=$PWD:/usr/src/myapp
WORKING_DIR=/usr/src/myapp
```

Get and run the gcc v7 gcc image
```
docker images
docker pull gcc:7
docker images
docker run -it -v $MOUNT_DIR -w $WORKING_DIR gcc:7 /bin/bash
gcc -v
```

Build a docker image from Dockerfiles/cpputest3_8.gcc7 and run a bash shell in it
```
docker build -t jamesgrenning/cpputest3_8.gcc7 -f Dockerfiles/cpputest3_8.gcc7 .
docker run -it -v $MOUNT_DIR -w $WORKING_DIR jamesgrenning/cpputest3_8.gcc7 /bin/bash
make
```

Now you are all set to edit in the native environment and run tests in the Docker container.

2 changes: 2 additions & 0 deletions code-t2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ INCLUDE_DIRS =\
include/devices\
include/MyOS\

LD_LIBRARIES += -lpthread

include ../CppUTestCompileFlags.mk
include $(CPPUTEST_HOME)/build/MakefileWorker.mk
6 changes: 6 additions & 0 deletions notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Add cpputest as a submodule
```
git submodule add git@github.com:cpputest/cpputest.git
cat .gitmodules
git commit -m "Added cpputest as a submodule"
```

0 comments on commit b0336af

Please sign in to comment.