• AVR Freaks

Hot!Unit testing boilerplate for PIC32

Author
crespum
Starting Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2016/10/18 08:28:19
  • Location: 0
  • Status: offline
2016/11/16 06:02:11 (permalink)
5 (2)

Unit testing boilerplate for PIC32

Hi,
 
I was spending too much time finding stupid bugs and manually testing my code, and specially code written by other people which I had to study first. That's why I decided to spend some time setting up a TDD environment for a PIC32-based project using Ceedling (Rake, Unity, Cmock).
 
I have uploaded the project to GitHub with a basic library for turning on an LED (more precisely a Neopixel). The library was not meant to be efficient whatsoever, the objective of this project is just to play with the unit testing framework so anyone can take it and integrate it for their own projects. So far I have created tests for the example code mocking calls to the SYS and PLIB libraries included in Harmony. It took quite some time to configure everything right, but it's finally ready to be used.
 
If anyone wants to start using TDD in their project (you definetily should), take a look at the project here: https://github.com/crespum/Ceedling-PIC32. Any contribution is welcome!
 
Pending features:
  • Run tests on the computer (because it's faster) compiling them with GCC. Right now tests run on the simulator given by Microchip.
  • Generate the final release with Ceedling.
 
Best regards,
Crespum.
#1
crespum
Starting Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2016/10/18 08:28:19
  • Location: 0
  • Status: offline
Re: Unit testing boilerplate for PIC32 2017/07/20 08:59:57 (permalink)
5 (1)
Hi everyone,
 
I've updated the project (https://github.com/crespum/Ceedling-PIC32) to support programming the target from the command line. It uses the IPE CLI tool and the PICKit.
 
Using Ceedling I can now run the tests on the simulator, create the release files (.hex and .elf) and program the target device. It's not perfect, but at least I won't need to open MPLAB most of the days!
 
I hope someone finds this useful.
Crespum
#2
jmrubillon
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2011/02/17 03:04:00
  • Location: 0
  • Status: offline
Re: Unit testing boilerplate for PIC32 2020/09/09 00:21:39 (permalink)
0
Hi all,

Inspired from this and the throw the switch xc16 based ceedling project I've created an xc8 version (https://github.com/jmrubillon/Ceedling_xc8).
Unlike the 32bit version I haven't added programming from the command line yet.

Hope someone will find it useful,
Jean
#3
Jump to:
© 2020 APG vNext Commercial Version 4.5