adafruit / Adafruit_Mynewt

Apache Mynewt documentation and test project for the nRF5x family of BLE SoCs
MIT License
8 stars 3 forks source link

Improve unit test output #25

Open microbuilder opened 8 years ago

microbuilder commented 8 years ago

Create a pull request that enables the following test output (perhaps optionally via a --verbose/-v flag or something similar):

hathach commented 8 years ago

maybe we just ask the devlist first to see if they added it in the develop branch. -v option is available but it got lots of compiling command line involved, not easy to follow.

microbuilder commented 8 years ago

Perhaps follow CMOCK output a bit, or something similar to this:

Starting 'TestSuiteName' test suite:
  Running 'Test Name' ... [OK][FAILED]
  Running 'Test Name' ... [OK][FAILED]
  [n] unit tests passed, [n] failed
Starting 'TestSuiteName' test suite:
  Running 'Test Name' ... [OK][FAILED]
  Running 'Test Name' ... [OK][FAILED]
  WARNING: 'Test Name' failed: error description or failed assert code
  [n] unit tests passed, [n] failed
Ran [n] unit tests in [n] test suites
[n] unit tests passed, [n] failed

This is just a suggestion, though, and if CMOCK has something better use that.

microbuilder commented 8 years ago

I think asking dev list is the right idea, but we should have a concrete proposal to discuss. It should be an easy addition though. I'll send an email if you want, but I think some simple unit tests will be good to avoid bugs and test custom services and libraries and avoid some of the headaches with early versions of Bluefruit like buffer overflows, etc.

hathach commented 8 years ago

Yeah print the TEST_CASE name indented by TEST SUITE is best, with number of failed and passed, I even modify CMOCK to print FAILED using ansi escape color RED to make it easier to spot as well :)

microbuilder commented 8 years ago

For reference sake, see conversation here under 'Improve Unit Tests': http://mail-archives.apache.org/mod_mbox/incubator-mynewt-dev/201610.mbox/browser