Niels Lohmann
fd0ca40ea6
Extract C++17-only content from unit-items.cpp into its own test file
...
unit-items.cpp is a 1433-line file that was being compiled twice per
CI configuration (once for C++11, once for C++17) purely because it
contained a single, small JSON_HAS_CPP_17-gated SECTION ("structured
bindings", 14 lines). Move that SECTION into a new, dedicated file
(tests/src/unit-items-cpp17.cpp) so only that tiny file needs a
second build; unit-items.cpp itself now builds/tests only once. No
tests/CMakeLists.txt changes are needed since the existing
file(GLOB ... src/unit-*.cpp) plus json_test_add_test_for() already
auto-register and standard-gate any new unit-*.cpp file based on
whether it textually contains JSON_HAS_CPP_<N> (the same mechanism
already used for the existing unit-iterators3.cpp file, which follows
the identical pattern).
Verified with plain clang++ under -std=c++11/14/17/20 and via a local
CMake configure+build that:
- unit-items.cpp now only produces a test-items_cpp11 target (the
former test-items_cpp17 target is gone) and its assertion/test-case
counts are unchanged (2 test cases / 222 assertions) for every
standard.
- The new unit-items-cpp17.cpp produces test-items-cpp17_cpp11 (an
intentionally empty translation unit under C++11 that reports 0
tests, 0 assertions, SUCCESS) and test-items-cpp17_cpp17 (1 test
case / 1 assertion, identical to what "structured bindings" ran
as before it was moved).
Separately, unit-regression1.cpp (1530 lines) was also being built
twice per CI configuration because it contained the substring
JSON_HAS_CPP_17 -- but on inspection this was dead code: an orphaned
"#ifdef JSON_HAS_CPP_17 / #include <variant> / #endif" left over from
when the actual std::variant-based regression test (issue #1292 ) was
relocated to unit-regression2.cpp. Nothing in unit-regression1.cpp
uses <variant>, so there is no SECTION/TEST_CASE to preserve here;
the dead include is simply removed. This was verified by grepping the
file for any other use of "variant" (none) and confirming issue #1292
is still covered by unit-regression2.cpp. Compiled and ran under
-std=c++11/14/17/20 and via CMake: unit-regression1.cpp now only
produces a test-regression1_cpp11 target (test-regression1_cpp17 is
gone) with an unchanged test-case count (3) under every standard.
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
2026-09-05 20:55:44 +02:00
Niels Lohmann
515d994acb
📄 adjust year ( #5044 )
...
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
2026-01-01 20:00:39 +01:00
Niels Lohmann
54be9b04f0
📄 update REUSE ( #4960 )
2025-10-23 06:56:36 +02:00
Niels Lohmann
30d27df61c
Fix CI ( #4871 )
...
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 👷 fix CI
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
---------
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
2025-07-31 20:10:57 +02:00
Niels Lohmann
e02de2f971
Update to Doctest 2.4.12 ( #4771 )
...
* ⬆️ Doctest 2.4.12
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 🚨 fix warnings
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
---------
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
2025-05-15 19:25:27 +02:00
Niels Lohmann
1705bfe914
🔖 set version to 3.12.0 ( #4727 )
...
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
2025-04-11 10:41:14 +02:00
Niels Lohmann
f06604fce0
Bump the copyright years ( #4606 )
...
* 📄 bump the copyright years
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 📄 bump the copyright years
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
* 📄 bump the copyright years
Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com >
---------
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com >
2025-01-19 17:04:17 +01:00
Harinath Nampally
d23291ba26
use diagnostic positions in exceptions ( #4585 )
...
* add a ci step for Json_Diagnostic_Positions
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* Update ci.cmake to address review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* address review comment
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* fix typo in the comment
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* fix typos in ci.cmake
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* invoke the new ci step from ubuntu.yml
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* issue4561 - use diagnostic positions for exceptions
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* fix ci_test_documentation check
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* address review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* fix ci check failures for unit-diagnostic-postions.cpp
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* improvements based on review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* fix const correctness string
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* further refinements based on reviews
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* add one more test case for full coverage
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* ci check fix - add const
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* add unit tests for json_diagnostic_postions only
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* fix ci_test_diagnostics
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
* fix ci_test_build_documentation check
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
---------
Signed-off-by: Harinath Nampally <harinath922@gmail.com >
2025-01-19 10:42:21 +01:00
Niels Lohmann
6057b31df7
Overwork astyle call ( #4573 )
...
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* Use ubuntu-latest image to run Valgrind (#4575 )
* 🔧 use Clang image to run valgrind
* 🔧 use Clang image to run valgrind
* 🔧 use Clang image to run valgrind
* 🔧 use Ubuntu image to run valgrind
* Use Clang image to run iwyu (#4574 )
* 🔧 use Clang image to run iwyu
* 🔧 use Clang image to run iwyu
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🔧 overwork astyle call
* 🎨 format code
* 🔨 clean up
2024-12-29 17:06:03 +01:00
Niels Lohmann
1b9a9d1f21
Update licenses ( #4521 )
...
* 📄 update licenses
* 📄 update licenses
2024-11-29 17:38:42 +01:00
Niels Lohmann
a97041a98f
Skip enum tests when JSON_DisableEnumSerialization=ON ( #4504 )
...
* ✅ skip enum tests when JSON_DisableEnumSerialization=ON
* ✅ skip enum tests when JSON_DisableEnumSerialization=ON
2024-11-21 17:19:16 +01:00
Niels Lohmann
9cca280a4d
JSON for Modern C++ 3.11.3 ( #4222 )
2023-11-28 22:36:31 +01:00
Niels Lohmann
f56c6e2e30
Update documentation for the next release ( #4216 )
2023-11-26 15:51:19 +01:00
Colby Haskell
59da644db4
Add more specific error message when attempting to parse empty input ( #4180 )
2023-10-31 20:17:43 +01:00
Niels Lohmann
836b7beca4
Fix CI, again ( #4083 )
2023-09-07 20:41:12 +02:00
Florian Albrechtskirchinger
3d1252bbff
Replace limit macros with std::numeric_limits ( #3723 )
2022-09-19 08:02:50 +02:00
Niels Lohmann and Florian Albrechtskirchinger
58bd97e2b1
Add clang-tools to required tools for ci_static_analysis_clang ( #3724 )
...
* 💚 add clang-tools to required tools for ci_static_analysis_clang
* 🚨 update Clang-Tidy warning selection
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings
* 🚨 fix Clang-Tidy warnings (#3738 )
* ⏪ revert fix
* ⏪ revert fix
* 🚨 fix Clang-Tidy warnings (#3739 )
Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com >
2022-09-13 12:58:26 +02:00
Niels Lohmann
9d69186291
🔖 set version to 3.11.2
2022-08-12 15:04:06 +02:00
Niels Lohmann
f2020da0dd
🔖 set version to 3.11.1
2022-08-01 23:27:58 +02:00
Florian Albrechtskirchinger
cbaf1033be
Fix global UDLs ( #3646 )
...
* Add ci_test_noglobaludls to CI
* Really default JSON_GLOBAL_UDLS to 1
* Test global UDLs
* Suppress warnings
* Clarify documentation
2022-08-01 22:42:35 +02:00
Niels Lohmann
ce0e13ccea
🔖 set version to 3.11.0
2022-07-31 23:19:06 +02:00
Florian Albrechtskirchinger
9aafcbe965
Move UDLs out of the global namespace ( #3605 )
...
* Move UDLs into nlohmann::literals::json_literals namespace
* Add 'using namespace' to unit tests
* Add 'using namespace' to examples
* Add 'using namespace' to README
* Move UDL mkdocs pages out of basic_json/
* Update documentation
* Update docset index
* Add JSON_GlobalUDLs CMake option
* Add unit test
* Build examples without global UDLs
* Add CI target
2022-07-31 17:38:52 +02:00
Niels Lohmann
feef0eb595
Add error message if test suite cannot be found ( #3585 )
...
* 🚸 add error message if test suite cannot be found
Fixes #3584
2022-07-20 12:41:33 +02:00
Niels Lohmann and Florian Albrechtskirchinger
527da54dcb
Use REUSE framework ( #3546 )
...
* 📄 add licenses
* 👷 add REUSE compliance check
* 📝 add badge for REUSE
Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com >
2022-07-20 12:38:07 +02:00
Florian Albrechtskirchinger
39e27684ea
Use DOCTEST_* compiler macros and suppress pragmas warning ( #3550 )
...
Use DOCTEST_* macros in place of predefined compiler macros for compiler
detection and version checks.
The suppression of warning -Wrange-loop-construct in unit-items.cpp
causes GCC<11 to warn about pragmas. Suppressed by adding a version
check.
2022-06-21 16:57:47 +02:00
Niels Lohmann
b21c345179
Reorganize directories ( #3462 )
...
* 🚚 move files
* 🚚 rename doc folder to docs
* 🚚 rename test folder to tests
2022-05-01 09:41:50 +02:00