Giter Club home page Giter Club logo

tddc-301_exercises's Introduction

TDDC-301 TDD for Embedded C exercises

Contents

These exercises require a number of additional development tools to be installed as described in the Toolchain setup section.

Ceedling

The projects can be tested locally using either ceedling directly or through docker.

Direct

$ cd solutions/exercise-N
$ ceedling test:all

Docker

$ docker run -v $(pwd):/usr/project -ti feabhas/ceedling-0.28.2 ceedling test:all

GCov

$ cd solutions/exercise-N
$ ceedling gcov:all
$ ceedling utils:gcov

Lizard

$ cd solutions/exercise-N/src
$ lizard

OCLint

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/

Documentation

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

Toolchain setup

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.

ruby

$ sudo apt install ruby-full

ceedling

see http://www.throwtheswitch.org/ceedling

$ sudo gem install ceedling

valgrind

sudo apt-get install -y valgrind

lizard

$ pip3 install lizard

OCLint

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

tddc-301_exercises's People

Contributors

martinbond7 avatar

Watchers

Niall Cooling avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.