marking cpp test targets.
Is there any way to mark tests (whether through ini, filename or otherwise) so that py.test -m=system_test or -m=unittest works with the tests?
Not currently, but I'm open to suggestions. :smile:
What's your use case exactly?
currently the use case would be to mark by feature set, types of tests and target module. i.e.: if i have a camera_lib .so being built from n classes, someone can run all the unittests for camera by running -m="unittest,camera_lib". Or someone can run all RPC interface tests that are marked as rpctest, endtoend and using_camera_lib. we have multiple test types/categories, these are just examples I brainstormed.
I see, thanks. Out of curiosity, do you use Boost.Python or Google Tests?
One option which is straightforward would be to automatically mark tests with the name of their executable, so all tests collected from camera_lib would have a camera_lib mark. Do you have other suggestions on how you would like to add some other custom marks?
Maybe if we could generate pytest (real) tests and each test would run the cpp test by command line then we could mark tests and have fixtures for them as well.
@nrbnlulu at runtime you mean? That's a possibility, but would require a significant rewrite of the plugin.