I was wondering if there were any suggestions on how it might be possible to improve the output of the unit tests to be a bit more verbose, following some of the other frameworks out there for embedded systems like CMOCK.

Unit testing and test simulation is an important part of the system for any professionally maintained project, but could be even more useful with a little bit of refinement.

Personally, I find it useful to see a list of tests being run and maybe spot if I missed a module, and to know how many tests were run, etc., so something like this when running the test suite(s)?

   Running 'TestSuiteName' test suite:
      Running 'Test Name' ... [OK][FAILED]
      Running 'Test Name' ... [OK][FAILED]
      [n] unit tests passed, [n] failed

   Running 'TestSuiteName' test suite:
      Running 'Test Name' ... [OK][FAILED]
      Running 'Test Name' ... [OK][FAILED]
      [n] unit tests passed, [n] failed

   Ran [n] unit tests in [n] test suites
   [n] unit tests passed, [n] failed

It's a poor example that needs more thought, but I was interested in getting the discussion started.

Also, having a 'startup' and 'teardown' function that runs before and after every unit test in the test suite may be nice as well to clear any variables or put things into a known state, but I'm also curious about opinions there.

Maybe have optional functions like this in every test suite module (this is taken from a project where we used CMOCK and UNITY: http://www.throwtheswitch.org/#download-section)

   void setUp(void)
   {
      fifo_clear(&ff_non_overwritable);
   }

   void tearDown(void)
   {

   }

Happy to help here, but wanted to get a discussion started first.

K.

Reply via email to