I came across a bug in the min-api for which I wanted to write a unit test. However, this wasn't really possible: the min-devkit repo was running the min-api tests. I felt like it would be better to have min-api tests in this repository so that's the reason for this PR.
While making this work, I had to make some changes in max-api and mock as well. A summary of all the changes:
max-api now uses a different CMake variable that makes less assumptions of the project's folder structure. The previous variable only worked in the context of packages with a similar structure as min-devkit. With the new variable, it also works for other projects - for example, the min-api with unit tests.
A side-effect of calling add_subdirectory(<min-api-repo>) in a min package was that the mock_kernel target got added. This made is a requirement for min packages to add the min-api repo as a subdirectory, even though that's a questionable action. So now, the mock_kernel gets added when adding an object unit test. It also adds the mock kernel as a dependency to these unit tests which solves build failures when compiling individual objects in min-devkit.
The above mention changes requires a change in mock: instead of making folder structure assumptions, the mock target dir can now be set as a variable.
The min-api gains a new min-tests target. The test's main.cpp file contains a unit test.
Existing tests are moved from individual targets to the min-tests target.
All tests automatically run on push/pull requests on master and develop.
I came across a bug in the min-api for which I wanted to write a unit test. However, this wasn't really possible: the min-devkit repo was running the min-api tests. I felt like it would be better to have min-api tests in this repository so that's the reason for this PR.
While making this work, I had to make some changes in
max-api
andmock
as well. A summary of all the changes:max-api
now uses a different CMake variable that makes less assumptions of the project's folder structure. The previous variable only worked in the context of packages with a similar structure as min-devkit. With the new variable, it also works for other projects - for example, the min-api with unit tests.add_subdirectory(<min-api-repo>)
in a min package was that themock_kernel
target got added. This made is a requirement for min packages to add the min-api repo as a subdirectory, even though that's a questionable action. So now, themock_kernel
gets added when adding an object unit test. It also adds the mock kernel as a dependency to these unit tests which solves build failures when compiling individual objects in min-devkit.mock
: instead of making folder structure assumptions, themock target dir
can now be set as a variable.min-tests
target. The test'smain.cpp
file contains a unit test.min-tests
target.