Using ceedling in Linux(WSL)

Introduction

This guide aims to describe how to install ceedling in a WSL Linux distribution. It assumes you already have Linux installed in WSL.

This will be using a snapshot not the current release. This will describe how to get Ceedling snapshot running as well using the gcov/gcovr plugin .

This is more of my personal notes, you can see the latest guide to install Ceedling in the respective github repository 


Requirements

Notes on versions:

In case issues occur in the future these are my current versions:

References


The minimum install

This is the minimum to get Ceedling going

Installing Ruby

Ceedling is a set of ruby scripts so you need to install it. No particular version is needed

sudo apt install ruby-rubygems 


Installing GDB

sudo apt install gdb


Installing Ceedling

This is to install the latest release of ceedling

sudo gem install ceedling


Trying it out

With that done you should be able to pull examples and try ceedling. Use help in any folder to get all the available commands in your current location

ceedling help

Snapshot

Personally, I am using a snapshot to get the newer features of ceedling. 


You will need download a .gem from https://github.com/ThrowTheSwitch/Ceedling/releases.

If you find one that you like I advise you to keep the .gem stored somewhere. Then just install it with the following command. Replace <path to .gem> with the path to the folder with the snapshot you just downloaded

sudo gem install --local "<path to .gem>"


Verify that the ceedling installed is at least 0.32.0

gem list --local ceedling
ceedling version



GCOV

Gcov is a really useful code coverage tool. Ceedling supports it as a plugin. It also uses gcovr, a python library, to generate HTML reports.  You will likely already have gcov installed already in Linux so this will just describe how to install gcovr.

There are some specific versions required.

This assumes you have Python already installed. Install gcovr v4.1:

pip install 'gcovr == 4.1'


Try it

To see if gcov is working correctly, use any of the examples you can pull fromCeedling. For example (check if the test runs first)

mkdir ./ceedling_test
cd ceedling_test
ceedling example temp_sensor .
ceedling test:all


And run gcov on it:

ceedling clobber gcov:all utils:gcov