mirror of
https://github.com/nlohmann/json.git
synced 2026-10-06 22:47:13 +00:00
* Fix CI on develop after #5600, #5607, and #5755 - binary_reader: cast the result of -1 - number back to number_integer_t, because a number_integer_t narrower than int is promoted to int, which GCC's -Warith-conversion rejects (ci_test_gcc, ci_test_standards_gcc) - JSON_DELETE_DEPRECATED_FUNCTIONS: declare the deleted stream operators as function templates at namespace scope, because GCC < 5 rejects deleted friend functions ("can't initialize friend function") and Clang 7-9 report a redefinition when a class template has a deleted friend function - docs: give the examples of JSON_USE_OBJECTS_FOR_ENUM_KEYED_MAPS "Example:" titles and add the page to the docset (style_check) Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Ignore libstdc++'s <format> sign change in the sanitizer job libstdc++ 14's <format> initializes a size_t parameter with -1 (GCC bug 119429), so every std::format call fails ci_test_clang_sanitizer under -fsanitize=integer (test-std-format_cpp20). Exclude only the implicit-integer-sign-change check and only that header via -fsanitize-ignorelist. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Fix the AppVeyor (MSVC 2015-2019) build - binary_reader: emit_signed/emit_unsigned pass integers that do not fit the number types to emit_float as long double, because MSVC's <cmath> has no integer overloads of std::isfinite (C2668 'fpclassify'), from #5607 - scalar comparisons: the friend operators take the JSON type for their noexcept from their parameter, because MSVC 2015/2017 take basic_json as the class template there (C3203) and MSVC 2019 16.0 does not see member types or template parameters, from #5751 - unit-conversions2: skip the !is_nothrow_constructible static_assert for std::optional on MSVC 2017, which evaluates the conditional noexcept as true (C2607), from #5754 Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Re-amalgamate Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Avoid MSVC 2015's C4800 for enums with underlying type bool MSVC 2015 warns about any conversion to bool (C4800), even with an explicit cast, so the enum conversions from #5754 (#5671) failed the AppVeyor build with /WX. Convert to bool by comparing with zero via the new detail::bool_aware_static_cast, and keep doctest from printing the enum in the test. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Skip the #5650 allocator test on MSVC 2015 debug builds MSVC 2015's debug STL constructs the containers' debug proxies through the allocator in noexcept constructors, so countdown_allocator's failing construction crashes test-allocator (SIGSEGV) instead of throwing std::bad_alloc. Use the guard #5585 uses for the same reason. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Skip deleted-function detection checks on MSVC 2015 MSVC 2015 does not treat selecting a deleted function in decltype as a substitution failure, so the detection traits in unit-delete_deprecated_functions (#5755) and the integral-key checks in unit-element_access2 (#5657) report deleted overloads as callable there. Calling them still fails to compile. Skip those checks for _MSC_VER < 1910, and use the stream operators for real in the runtime section, so MSVC 2015 still compiles them with the macro set. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Split the Visual Studio 2017 AppVeyor jobs in two The VS 2017 jobs hit AppVeyor's 60-minute limit per job while still compiling the tests (77 of about 108 test targets after 58 minutes). They pass /std:c++17 for everything anyway, so build only the C++17 variant of each test (JSON_TestStandards=17), and split the unit test files across two jobs each with the new JSON_TestShard=<index>/<count> option, which keeps every <count>-th test file starting at <index>. The extra variants of single test files are built in shard 0 only. CMAKE_OPTIONS is no longer quoted in appveyor.yml, so that it can hold more than one option. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Fix std::terminate when converting std::optional with MSVC 2017 MSVC 2017 evaluates std::is_nothrow_assignable<json&, const T&> as true even if T's to_json throws, so to_json(json&, const std::optional<T>&) was noexcept there and the exception from #5642's test called std::terminate instead of propagating. Make that conversion never noexcept on MSVC 2017; all other compilers keep the exact condition. The static_asserts on the condition are skipped for MSVC 2017; the runtime check that the exception propagates still runs there. Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
96 lines
3.2 KiB
YAML
96 lines
3.2 KiB
YAML
version: '{build}'
|
|
|
|
# only build PRs and commits to develop branch
|
|
# (see https://help.appveyor.com/discussions/questions/55079-two-builds-per-commit-to-pull-request)
|
|
branches:
|
|
only:
|
|
- develop
|
|
|
|
only_commits:
|
|
files:
|
|
- .github/external_ci/appveyor.yml
|
|
- cmake/
|
|
- include/
|
|
- tests/
|
|
- CMakeLists.txt
|
|
|
|
environment:
|
|
matrix:
|
|
# The Visual Studio 2017 jobs compile everything with /std:c++17, so they
|
|
# only build the C++17 variant of each test, split into two jobs each to
|
|
# stay below AppVeyor's 60-minute limit per job.
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
configuration: Debug
|
|
platform: x86
|
|
CXX_FLAGS: "/W4 /WX"
|
|
CMAKE_OPTIONS: ""
|
|
GENERATOR: Visual Studio 14 2015
|
|
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
configuration: Release
|
|
platform: x86
|
|
CXX_FLAGS: "/W4 /WX"
|
|
CMAKE_OPTIONS: ""
|
|
GENERATOR: Visual Studio 14 2015
|
|
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
configuration: Release
|
|
platform: x86
|
|
CXX_FLAGS: "/permissive- /std:c++17 /utf-8 /W4 /WX"
|
|
CMAKE_OPTIONS: "-DJSON_TestStandards=17 -DJSON_TestShard=0/2"
|
|
GENERATOR: Visual Studio 15 2017
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
configuration: Release
|
|
platform: x86
|
|
CXX_FLAGS: "/permissive- /std:c++17 /utf-8 /W4 /WX"
|
|
CMAKE_OPTIONS: "-DJSON_TestStandards=17 -DJSON_TestShard=1/2"
|
|
GENERATOR: Visual Studio 15 2017
|
|
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
|
configuration: Release
|
|
platform: x86
|
|
CXX_FLAGS: "/W4 /WX"
|
|
CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
|
|
GENERATOR: Visual Studio 16 2019
|
|
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
configuration: Release
|
|
platform: x64
|
|
CXX_FLAGS: "/W4 /WX"
|
|
CMAKE_OPTIONS: ""
|
|
GENERATOR: Visual Studio 14 2015
|
|
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
configuration: Release
|
|
platform: x64
|
|
CXX_FLAGS: "/permissive- /std:c++17 /Zc:__cplusplus /utf-8 /W4 /WX"
|
|
CMAKE_OPTIONS: "-DJSON_TestStandards=17 -DJSON_TestShard=0/2"
|
|
GENERATOR: Visual Studio 15 2017
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
configuration: Release
|
|
platform: x64
|
|
CXX_FLAGS: "/permissive- /std:c++17 /Zc:__cplusplus /utf-8 /W4 /WX"
|
|
CMAKE_OPTIONS: "-DJSON_TestStandards=17 -DJSON_TestShard=1/2"
|
|
GENERATOR: Visual Studio 15 2017
|
|
|
|
init:
|
|
- cmake --version
|
|
- msbuild /version
|
|
|
|
install:
|
|
- if "%platform%"=="x86" set GENERATOR_PLATFORM=Win32
|
|
|
|
before_build:
|
|
- cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On %CMAKE_OPTIONS%
|
|
|
|
build_script:
|
|
- cmake --build . --config "%configuration%" --parallel 2
|
|
|
|
test_script:
|
|
- if "%configuration%"=="Release" ctest -C "%configuration%" --parallel 2 --output-on-failure
|
|
# On Debug builds, skip test-unicode_all
|
|
# as it is extremely slow to run and cause
|
|
# occasional timeouts on AppVeyor.
|
|
# More info: https://github.com/nlohmann/json/pull/1570
|
|
- if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode" -C "%configuration%" --parallel 2 --output-on-failure
|