mynewt-newt
mynewt-newt copied to clipboard
Add unit tests when generating 'PACKAGE_TYPE_LIB'
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.
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