-
-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong set of tests registered with TEST_CASE_TEMPLATE get executed #228
Comments
I have a minimal example: In #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest.h> in #include <doctest.h>
#include <string>
TYPE_TO_STRING(std::string);
TEST_CASE_TEMPLATE("a", T, std::string) {} in #include <doctest.h>
#include <string>
TYPE_TO_STRING(std::string);
TEST_CASE_TEMPLATE("b", T, std::string) {} Compiled everything, running
So no mention of
|
I reproduced it... Thanks for reporting! I'll look into this ASAP |
This is due to an ODR violation... horrible and nasty bug - thanks for catching it! The problem is that this constructor is implicitly inline and is thus a weak symbol so if there are multiple copies of it (with the same types for the template) in different source files with the same names then only 1 copy would be left (by random - or object file include order - AKA random) because of the linker removing all other duplicates. Currently "unique" names are generated using Alternatively I could add So I'm currently trying to figure out how to rewrite it so the symbols aren't weak. |
…tering class and the template function itself is also static
try it out now - should be fine - just pushed into the dev branch (will release an official version ... "soon"-ish) |
Works great, thanks for fixing this so fast! |
An critical fix to doctest/doctest#228
An critical fix to doctest/doctest#228
Description
I have two separate cpp files. In one I have a test case like this:
In the other .cpp file I have this:
It seems that somehow doctest does not like that. When I execute my binary with
-ltc
I get this output:It seems I cannot execute the "bench distinctness" tests, they somehow are erroneously mapped to the "copy and assign maps" tests.
The text was updated successfully, but these errors were encountered: