IncludeOS icon indicating copy to clipboard operation
IncludeOS copied to clipboard

Improve build/run system for unit tests

Open alfreb opened this issue 8 years ago • 2 comments

  • [ ] Build all the relevant .cpp-files from the OS
  • [ ] Calculate test coverage

alfreb avatar Aug 22 '16 11:08 alfreb

I really like the test auto-discovery functionality from the existing Makefile, but would like the ability to ignore broken tests.

If you are desperate for coverage info, feel free to cherry-pick what you need from my WIP makefile:

https://gist.github.com/ingve/4e81c41df966cf125858637b46bcb56c

"Build all the relevant .cpp-files from the OS" is probably different in the test vs. coverage scenario? In the test scenario we want to build all the cpp files that have tests, but not the cpp files we have no corresponding test cases for (to keep the test/feedback cycle short).

In the coverage scenario we probably want to build all the cpp files, to get the denominator for the coverage percentage correct?

ingve avatar Aug 22 '16 11:08 ingve

Hi, that file looks great! Regarding objects / .cpp-files, Ideally I'd like to have a single bunch of .o files (or even a .a archive) available to lest and let the linker decide which ones it needs. If you run a single test (e.g. like the current make single ...), it will only link in the symbols needed for that test and if you make all the tests into one binary (e.g. for coverage) it will need many more (ideally all) the OS objects. Shouldn't that work?

alfreb avatar Aug 22 '16 12:08 alfreb