Commit Graph

197 Commits

Author SHA1 Message Date
Victor Zverovich d24fef27d1 Minor cleanup 2026-06-26 15:57:41 -07:00
Jan Engelhardt 719823cc64 Turn libfmt-c into a shared library (#4812)
Linux distros don't like having static archives. Set fmt-c to shared
just like the main fmt library.
2026-06-26 06:55:44 -07:00
Mathew Benson 8783c3c2d4 enable fmt_module tests by updating module-test.cc (#4702)
- 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.
- Update CI for linux and macos to add verbosity so its consistent with
  windows.
- 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 removed.
- Refactored tests related to `fmt::format_args` that now requires lvalue
  references as opposed to direct values.
- Remove the none-working code identified in the `module-test.cc` file
  while updating.
2026-04-12 10:07:16 -07:00
Victor Zverovich e090e3ffad Apply cmake-format 2026-03-03 15:49:40 -08:00
Victor Zverovich eef9ff4938 Fix module test 2026-03-03 12:53:45 -08:00
Victor Zverovich 011b24123b Cleanup module test 2026-03-03 12:30:54 -08:00
Mathew Benson 4e1b170b44 Add Separate CMake Target for C++20 Modules (#4685)
* Add Separate CMake Target for C++20 Modules

In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.

The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake

The `add_module_library` function is marked as deprecated as its
functionality is superseded.

Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this

* Add Separate CMake Target for C++20 Modules

In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.

The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake

Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this

Fixed the test/CMakeLists.txt file which used the FMT_MODULE flag to
separate the module and non-module library testing, in particular
disableing the module version.

The module testing still needs to be fixed, but the expected behavior of
testing the non-modular version is working.

---------

Co-authored-by: Mathew Benson <mathew@benson.co.ke>
Co-authored-by: ClausKlein <claus.klein@arcormail.de>
2026-03-02 09:11:31 -08:00
Victor Zverovich dc97113ca1 Cleanup the C API 2026-02-21 17:15:19 -08:00
Zephyr Lykos 2a50a0d808 Remove unused symbol check (#4625)
Fixes: 56d7a8c157
Fixes: a3bf40838f
2025-12-08 12:23:37 -08:00
Victor Zverovich 7a0da1c68a Merge compile-time FP tests into other compile-time tests 2025-11-22 07:46:38 -08:00
Victor Zverovich c68c5fa7c7 Test FMT_BUILTIN_TYPES 2024-10-04 16:08:46 -07:00
Victor Zverovich 9fcd9c4c12 Remove all warning suppressions 2024-07-22 12:41:12 -07:00
Victor Zverovich e10643add2 Add a perf-sanity test 2024-07-14 14:17:39 -07:00
Victor Zverovich e50c8b6bd8 Fix disabling Unicode support 2024-07-04 07:27:22 -07:00
Victor Zverovich b7809f91e2 Enable Unicode support by default 2024-05-11 15:11:23 -07:00
Victor Zverovich 6b68dff901 Write directly to a stream buffer 2024-01-18 16:27:12 -08:00
Victor Zverovich f924d20dbd core-test -> base-test 2024-01-14 06:57:01 -08:00
Dana Jansens f6ca4ea199 Avoid a space in the UDL definition (#3610)
* Avoid a space in the UDL definition except on GCC before 4.9

Clang 18 has grown a warning about the space being deprecated which
is enabled by default in their nightly binaries. However GCC before 4.9
will reject the UDL definition unless there is a space there, so we need
to keep the space conditionally for it.

* Remove UDLs on GCC before 4.9 to simplify things

GCC before 4.9 rejects the syntax that is now
rejected on more modern compilers.

* Disable compile-error-test on GCC < 4.9

This avoids the UDL tests failing as GCC < 4.9 can not parse UDLs
without a space, but the space is malformed in modern compilers.
2023-09-18 08:09:42 -07:00
Daniela Engert d7a8e50cb5 Improve module testing (#3397)
* use the standard `test-main.cc` component instead of injected test infrastructure sources
 * undo now obsolete commit `00235d8a` from July 2021
 * Clang cannot import user-defined literals as it seems -> disable test
 * Clang emits duplicate, non-mergeable copies of `detail::buffer`'s vtable, causing linker errors -> disable test
2023-05-03 07:56:24 -07:00
Victor Zverovich d97d8cea67 Push module check to test 2023-04-14 11:42:01 -07:00
Vladislav Shchapov 74c51ff37e Skip only strptime dependent test in scan-test
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-11-27 08:59:30 -08:00
Chris Thrasher 69ffedfe52 Use target_compile_features to specify C++ standard requirement 2022-11-26 11:03:17 -08:00
thesmurph c7980542d3 Skip the scan-test if strptime isn't defined (#3184)
cygwin and embedded systems. By default newlib doesn't provide strptime
in time.h because it was added in a later X/Open versions. Issue: #3178
2022-11-16 09:42:01 -08:00
Tinson Lai 5ad7b71381 Fix options for C++20 experimental module in CMake (#3134)
* Fix options for C++20 experimental module in CMake

* Replace `FMT_CAN_MODULE` by `FMT_MODULE` in test/CMakeLists.txt
2022-10-12 08:23:12 -07:00
Vladislav Shchapov 3a3b0709e2 Disable bogus -Wstringop-overflow on GCC 11 (#3054)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-24 12:37:34 -07:00
Dimitrij Mijoski bbcb129e02 Reduce filesize of the tests on MinGW (#2995)
This patch removes the workaround applied here
1acfd07f1e.
MinGW is not tested on Appveyor anymore.
2022-07-22 20:11:33 -07:00
Vladislav Shchapov 99bb5b1d17 Fix std::variant, std::filesystem::path tests on GCC-8, Clang-7,8.
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-02 08:34:52 -07:00
Vladislav Shchapov f0de128449 Remove /source-charset:utf-8 compile option.
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-06-19 07:37:39 -07:00
Vladislav Shchapov 232e21d51f Add utf-8 test for std::filesystem::path formatter.
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-06-04 10:10:21 -07:00
Victor Zverovich 9730fb0156 Fix path formatter 2022-05-17 14:29:49 -07:00
Mattias Ljungström a935ac3e60 MSVC CMake generation optimization (#2852) 2022-04-08 06:27:23 -07:00
Boris Dalstein e3d688e79a Fix warning C4251: class fmt::v8::file needs to have dll-interface (#2797)
* Fix warning C4251: class fmt::v8::file needs to have dll-interface

* Add CMake target dependency between test-main and fmt
2022-03-07 12:09:48 -08:00
Victor Zverovich afbcf1e8ea Remove legacy C locale wrapper 2022-02-05 12:37:21 -08:00
Alexey Ochapov 1164eda5af disable compile-error-test on Windows
since it takes too much time to complete, similar to other tests with additional
CMake invocation
2021-12-27 20:55:06 -08:00
Alexey Ochapov 4482f6f1f0 rewrite compile-error-test to use non-header-only library 2021-12-27 20:55:06 -08:00
Vladislav Shchapov 33ee4cc516 Improve noexception test 2021-12-26 16:28:41 -08:00
Alexey Ochapov 817788fbf0 remove incorrect C++20 check from test/CMakeLists.txt (#2663)
It disables entire branch of tests declaration unconditionally because CXX_STANDARD
is not defined there. But even we use CMAKE_CXX_STANDARD here, these tests should
not be disabled with standard >= C++20.
2021-12-23 12:32:03 -08:00
Victor Zverovich 664cd6067d Remove std-format-test 2021-12-23 10:58:02 -08:00
Alexey Ochapov 51b14b6c0c remove commented out lines 2021-12-17 16:05:56 -08:00
Alexey Ochapov 223a0fa55d move gtest-specific check into gtest/CMakeLists.txt 2021-12-17 16:05:56 -08:00
Alexey Ochapov b4d9d82e1d make FP formatting available to be used at compile-time (#2426)
* works only with FMT_HEADER_ONLY
* works only with float and double types (not long double)
2021-09-18 08:03:23 -07:00
Pierre-Antoine Lacaze d58d19ba32 Fix an odr violation in ranges.h (#2483)
* Add a testcase demonstrating ODR violation in ranges.h

* Fix ODR violation in ranges.h

* Fix comments

Co-authored-by: Pierre-Antoine Lacaze <pa.lacaze@gmail.com>
2021-09-02 08:47:44 -07:00
Vladislav Shchapov 07211701f4 Disable the -Wstringop-overflow warning from GCC 7 (#2442) 2021-08-02 14:20:18 -07:00
Daniela Engert f2b03facd9 Include test sources to pick up functions and classes from the module rather than from the non-modular library which is baked into the test-main library. (#2356)
This averts linker problems:
 - strong ownership model: missing linker symbols
 - weak ownership model: duplicate linker symbols

Simplify `gtest-extra.cc` while at it.
2021-07-03 07:21:54 -07:00
Daniela Engert 5221242f6e Instruct msvc to report the _true_ value in __cplusplus and force _full_ C++ conformance
* do this  in _some_ tests to improve test coverage and catch possible problems due to that
 * fix invalid export of `static constexpr` constant
 * fix msvc warnings about unreachable code in high warning levels
2021-06-24 09:10:08 -07:00
Daniela Engert 59a298f124 Enable enforce-checks-test for MSVC, too 2021-06-10 12:54:54 -07:00
Victor Zverovich 16c3514d01 wchar-test -> xchar-test 2021-06-06 07:59:18 -07:00
Владислав Щапов f286139d22 Fix "undefined reference to `fmt::v7::detail::basic_data<void>::digits'"
Remove unused FMT_EXTERN_TEMPLATE_API
2021-06-02 14:33:17 -07:00
Daniela Engert 70e67ae018 Re-enable module testing
Prepare for compilation with gcc (modules branch).
2021-06-01 14:49:56 -07:00
Victor Zverovich bf9904ee4d Workaround msvc bugs 2021-05-31 08:25:05 -07:00