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
Bug: order-by=file is compiler-dependent #287
Comments
I'll take a look as soon as possible but it could take 1-2 days... sorry. |
I noticed now that its not only the clang-cl builds which fail but also some cl builds: EDIT: you actually mentioned cl as well in the issue so it was never reported only for clang-cl... |
When using When using When using So basically, we're going to have to do some sort of path normalization if we want reliable results from |
Gosh... such "exciting" software engineering problems! one thing we could do is to use either a new hidden flag or One of the pros of not normalizing paths (and using something like EDIT: I'm open for feedback :| |
Is it an option to change the default This feels like an edge case without a clean solution (at least until we can think of something) so I'd rather just avoid it from occurring for now. EDIT: we could also just change the |
indeed I think changing the order to "name" or "suite" will do the trick! And we should rename this issue to reflect the actual problem. |
Should I change it just for the test or the default value? I think changing the default value is "the right thing to do" as the current behaviour is broken but users might be relying on the default order so it would be a breaking change. I think changing the order just for the test is the safest thing for now. I'll also add documentation to the |
yes, changing it for the test only should be the safest thing to do. |
We could still keep this open, since the bug is still present..? |
Of course, my bad. |
Ok this is horrible, but it solved our problem. Putting this here for others with simular problems. We are compiling using cmake + clang + ninja on windows. in all source and header files we only include the name: #include "file.hpp". in the cmake file we declare include folders with:
In our project, when we include a .hpp file from a .cpp file doctest get:
but if we include a .hpp from another .hpp it results in:
As we put tests in file.hpp, and include from .cpp and .hpp files those tests will run twice. m_type = type; // line 4255 in doctest.h
m_template_id = template_id; // line 4256 in doctest.h
for (size_t i = 0; i < m_file.size(); i++)
{
if (m_file[i] == '\\')
{
m_file[i] = '/';
}
} |
See https://github.com/DaanDeMeyer/doctest/runs/216609947.
Even more weird is that the output not only differs from the rest of the compilers but the output also differs between cl and clang-cl as well.
The text was updated successfully, but these errors were encountered: