Contents
These exercises require a number of additional development tools to be installed as described in the Toolchain setup section.
The projects can be tested locally using either ceedling directly or through docker.
$ cd solutions/exercise-N
$ ceedling test:all
$ docker run -v $(pwd):/usr/project -ti feabhas/ceedling-0.28.2 ceedling test:all
$ cd solutions/exercise-N
$ ceedling gcov:all
$ ceedling utils:gcov
$ cd solutions/exercise-N/src
$ lizard
Make sure you upasked the OClint achive and the bin
folder to your
search PATH
. Assuming OCLint 22.02 has been placed in your home directory
run this command to add oclint
for your current login session:
$ PATH="$PATH:$HOME/bin/oclint-22.02/bin"
Run the analysis on your workspace sourfce folder:
cd solutions/exercise-N
oclint src/*.c -- -c -I vendor/ceedling/vendor/unity/src/
To generate the Doxygen
documentation:
$ cd solutions/exercise-N/src
$ docker run --rm -it -v $(pwd):/app corentinaltepe/doxygen doxygen Doxyfile
The generated html can be found at:
doc/html/index.htm
e.g.
./solutions/exercise-1/src/doc/html/index.html
In addition to the standard C/C++ Toolchain the following supporting tools disussed during training must be installed for these exercises.
Instructions are for Ubuntu Linux but should work on macOS.
$ sudo apt install ruby-full
see http://www.throwtheswitch.org/ceedling
$ sudo gem install ceedling
sudo apt-get install -y valgrind
$ pip3 install lizard
Download the appropriate archive from the OClint releases page.
Assuming this download is OClint v22.02 built for Ubuntu and saved in your
Downloads
folder you can unpack the download into you home folder using:
$ tar xvf ~\Downloads\oclint-22.02-llvm-13.0.1-x86_64-linux-ubuntu-20.04.tar
You need to include oclint on your search PATH
which you can do for the current
terminal session using the command:
$ PATH="$PATH:$HOME/oclint-22.02/bin"
You can add the following to you login profile (file ~/.profile
) to make
this change persistent across login sessions:
OCLINT_BIN="$HOME/oclint-22.02/bin"
if [[ -x $OCLINT_BIN/oclint ]]; then
PATH="$PATH:$OCLINT_BIN"
fi