Re-Enable fmt module tests, update module-test.cc#4702
Re-Enable fmt module tests, update module-test.cc#4702MathewBensonCode wants to merge 1 commit intofmtlib:mainfrom
Conversation
12b77b8 to
789a28f
Compare
|
@vitaut, what is the scope of testing that we require for testing the module target? Do we just want to test the public API or the full API? The tests for the regular library involve tests for the entire library as they are able to reach into the entire code base. With the module based library, it brings up the issue of visible and invisible APIs. In this pull request, Ideally I have just remove the "inner" code(and some outdated code), which is being tested by the regular library anyway, and just test that the expected public functionality works. I have commented out the bits that would be deleted if we we're to take this approach. The other approach would be to work out how to work with modules and macro based testing frameworks. I'm doing some experiments with this, but it may need another pull request as the changes are likely to be drastic, like moving tests into headers, or making the tests part of the module, etc. |
|
We definitely don't need to test everything. A simple sanity test that exercises a small subset of the API should be sufficient. I would recommend splitting the changes into smaller PRs, e.g. focusing on one compiler (e.g. clang) first. |
|
That said, we shouldn't delete code from the module test if it is broken with modules. On the contrary - we should keep it as a regression test for the fix. It is OK to conditionally compile it until the fix is available. |
789a28f to
8241bd6
Compare
|
After further investigation, I have identified that the wide string versions of most tests in I have just commented them out with explanations in the comments, however, these may be candidates for removal as I observed that they we're not present in the other Compiler Specific testing does not appear to be an issue in this case. The module-test.cc file was well written to only deal with module tests so likely just needed to be updated. module-test run visible here: https://github.com/fmtlib/fmt/actions/runs/22850169158/job/66276473337?pr=4702#step:7:1404 |
8241bd6 to
b11dc45
Compare
vitaut
left a comment
There was a problem hiding this comment.
Please apply cmake-format and revert unrelated changes.
6f6bce7 to
9acd195
Compare
9acd195 to
acc41f6
Compare
acc41f6 to
a4eee9e
Compare
42644b0 to
c368f5f
Compare
vitaut
left a comment
There was a problem hiding this comment.
Looks like there are some merge conflicts, please rebase.
c368f5f to
bdc1e5e
Compare
- Update g++ module testing to use g++ version 15 instead of 14. The module support in version 14 isn't very stable and the module testing was not working due to unresolved locale symbols. - Refactor test/CMakeLists.txt to enable testing for modules - The tests in `module-test.cc` seem to not have been updated in some time despite changes in the main library. - Wide String versions of several tests appear to be deprecated so have been commented out. - Refactored tests related to `fmt::format_args` that now requires lvalue references as opposed to direct values. - MSVC has some bugs that are still present since the module-test.cc file was initially written. We update the version detection to current versions. - MSVC and the other compilers take different paths in determining the fmt::detail namespace. Used #ifdef macros to enforce this. This enables module testing to work on all compilers - clang-format base.h due to lint failure on CI
bdc1e5e to
f22e798
Compare
module-test.ccseem to not have been updated in some time despite changes in the main library.fmt::format_argsthat now requires lvalue references as opposed to direct values.fmt::is_charandfmt::localtimeas far as I can tellShould close #4698