tests/unittests: allow out-of-tree tests#21328
Conversation
mguetschow
left a comment
There was a problem hiding this comment.
What's the benefit of reusing tests/unittests rather than writing your own (out-of-tree) application that contains the unittest?
In any case, I'd like to have a corresponding test akin to https://github.com/RIOT-OS/RIOT/tree/master/tests/build_system/external_board_dirs
| same naming convention (each folder in `EXTERNAL_UNIT_TEST_DIRS` should have | ||
| `tests-<name>` folders containing the unit tests). | ||
|
|
||
| This feature works best with `EXTERNAL_MODULE_DIRS` that contain the code the |
There was a problem hiding this comment.
Since this is the envisioned use-case, would you mind adding a pointer to it the documentation over at https://doc.riot-os.org/creating-modules.html?
There was a problem hiding this comment.
I would also work nicely with other EXTERNAL_*_DIRS, right?
There was a problem hiding this comment.
Yes, it would work with about any folder containing extra unit tests. So if you external board has unit tests, this would also work here.
The motivation is two-fold:
|
|
I added a small test app that has both an internal and an external unit test. The python runner checks that two tests are run. |
6cdd155 to
908789b
Compare
908789b to
48141bd
Compare
|
This needs a rebase. |
48141bd to
f4f583f
Compare
f4f583f to
cecc1c6
Compare
|
Good catch. Let's see if this does the trick |
This adds and documents the new `EXTERNAL_UNIT_TEST_DIRS` environment variable that allows including out-of-tree unit tests. The intention is to allow users of `EXTERNAL_MODULE_DIRS` to also provide corresponding unit tests and run them all with a single test app. Co-authored-by: crasbe <[email protected]>
cecc1c6 to
eff6816
Compare

Contribution description
This adds and documents the new
EXTERNAL_UNIT_TEST_DIRSenvironment variable that allows including out-of-tree unit tests. The intention is to allow users ofEXTERNAL_MODULE_DIRSto also provide corresponding unit tests and run them all with a single test app.Testing procedure
Export both
EXTERNAL_MDOULE_DIRSandEXTERNAL_UNIT_TEST_DIRS, then build and run the unit tests. The external tests should now be included.Run again with both variables unset, and only the internal tests should be build and run as before.
Issues/PRs references
None