2

I'm currently working on an embedded device which is able to run unit tests, thanks to the Unity framework. I send the output of these tests into my computer with a JLINK and SEGGER_RTT. Question is, how can i make a web report from unity output?

The best lead I have found, was to transform Unity content to JUnit, in order to have more libraries to work with. Problem is, i didn't find the best approach to have with this JUnit. The idea is to have almost nothing to install, to be able to run tests on a new computer and to have an ergonomic/modern web UI to fastly treat unit tests. The best library i found was Allure (https://github.com/allure-framework/allure2), but I was wondering if it was the best approach (many things to install, and to do before i have anything).

Blue
  • 820
  • 4
  • 17
thomas_exotic
  • 211
  • 1
  • 7
  • Just out of curiosity: what is the point of running unit tests on an embedded device? What is the benefit of doing that? Are you rather talking about some kind of integration test here? – GhostCat Apr 24 '17 at 12:01
  • @GhostCat Running tests is usually considered most worthwhile when done in the environment that the program is to be executed in when in production – Toby Apr 24 '17 at 12:48
  • allure 2 supports JUnit.xml test format. Simply download allure2 beta8 https://bintray.com/qameta/generic/allure2 and run `$ allure serve --profile junit junit-output/` – Dmitry Baev Apr 24 '17 at 13:23
  • Also we can consider to support Unity test output format if you link me the docs about it – Dmitry Baev Apr 24 '17 at 13:24
  • Thanks for the reply Firstly, here is a link to the Unity Github : [link](https://github.com/ThrowTheSwitch/Unity). There is the documentation in the "docs" folder, and some help/utilies in "auto" that may help you. It would be great for many people to have Unity support in Allure. Secondly, i tried the command line you sent. It works well, it generates an Allure repports, but datas are empty (ALLURE REPORT UNKNOWN). My "junit-output" is a folder with one file (results.xml), with this content : https://pastebin.com/p93iEdWb . Could you tell me what's wrong? – thomas_exotic Apr 25 '17 at 07:43

1 Answers1

2

Thomas, have you looked at Ceedling (from the same people that make Unity)? Check out the plugins for it https://github.com/ThrowTheSwitch/Ceedling/tree/master/plugins some of which allow the format of the test ouptut to be adjusted.

Basically Ceedling provides a Ruby build system for Unity with lots of added features like mock generation and the plugin structure - you only need to use the bits you want though

One of the plugins, gcov, also generates test coverage information, which ceedling can also use to generate a HTML test coverage report similar to below

enter image description here

Toby
  • 9,696
  • 16
  • 68
  • 132
  • Thanks for the reply. I tried to work with Ceedling, but as the config file was a little bit complicated to set, i didn't manage to get further at this moment. I'll take a look at your solution later, because it seems really better for an automatic solution. – thomas_exotic Apr 25 '17 at 07:52
  • I thought the same when I started using it as I'd no previous experience of Ruby or YAML (which ceedling uses), but once I put in a little time to get to grips with it I found it worth the investment. Plus, Mike and the folks are really good at helping out with issues posted on the relevant Github repository if you have problems :-) – Toby Apr 25 '17 at 08:02