Namespace tests with filename to reduce test naming conflicts #2175
Labels
Comments
|
You aren't first to ask this, and there is a relatively simple workaround, as long as you keep your test case named with string literals (strictly speaking you don't have to). This should work #define FILE_TEST_CASE(...) (__FILE__ __VA_ARGS__)Caveats: It is too early in the morning to think about anonymous test cases ( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I have a hardware abstraction layer interface, as well as a driver interface. I have multiple drivers utilizing the HAL interface, while implementing the driver interface. This plugin approach causes me to have identically named tests across multiple test files.
For example:
When I attempt to compile multiple test files into a single test runner, then I get the following name collisions...
I noticed you have a flag on the test binary,
--filenames-as-tags. I am curious if you could incorporate the "test case + tags" into a test identifier to achieve uniqueness.This seems like an elegant solution to this problem, unless you already have a workaround. If so, would you please share the preferred pattern with me.
Thanks,
Zak
The text was updated successfully, but these errors were encountered: