mynewt-newt icon indicating copy to clipboard operation
mynewt-newt copied to clipboard

Add unit tests when generating 'PACKAGE_TYPE_LIB'

Open microbuilder opened this issue 7 years ago • 1 comments
trafficstars

Unit tests are not only helpful to promote code quality, they are also useful documentation for packages, and are generally up to date with any API changes.

As such, would it make sense to include unit tests by default in any new package created with newt pkg new (assuming the default PACKAGE_TYPE_LIB package type)?

This inclusion may push people to create more unit tests, and if they aren't desired it's simply a matter of deleting the appropriate sub-directory.

microbuilder avatar Sep 20 '18 01:09 microbuilder

As an update, unit tests are also the only way to run travis-ci tests on stand-alone packages/libs committed to Github since there isn't a project to build. See, for example, https://github.com/microbuilder/mb_ht16k33/blob/master/.travis.yml ... which requires a very simple unit test just to check that the package builds on PRs and commits: https://github.com/microbuilder/mb_ht16k33/blob/master/test/src/testcases/ht16k33_testcases.c

microbuilder avatar Sep 28 '18 09:09 microbuilder