Merge branch 'develop' of https://github.com/nlohmann/json into new_ci
This commit is contained in:
commit
ba6307a6ea
@ -66,15 +66,15 @@ 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%"
|
- 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:
|
build_script:
|
||||||
- cmake --build . --config "%configuration%"
|
- cmake --build . --config "%configuration%" --parallel 2
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- if "%configuration%"=="Release" ctest -C "%configuration%" -V -j
|
- if "%configuration%"=="Release" ctest -C "%configuration%" --parallel 2 --output-on-failure
|
||||||
# On Debug builds, skip test-unicode_all
|
# On Debug builds, skip test-unicode_all
|
||||||
# as it is extremely slow to run and cause
|
# as it is extremely slow to run and cause
|
||||||
# occasional timeouts on AppVeyor.
|
# occasional timeouts on AppVeyor.
|
||||||
# More info: https://github.com/nlohmann/json/pull/1570
|
# More info: https://github.com/nlohmann/json/pull/1570
|
||||||
- if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode" -C "%configuration%" -V -j
|
- if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode" -C "%configuration%" --parallel 2 --output-on-failure
|
||||||
|
|
||||||
# only build PRs and commits to develop branch
|
# only build PRs and commits to develop branch
|
||||||
# (see https://help.appveyor.com/discussions/questions/55079-two-builds-per-commit-to-pull-request)
|
# (see https://help.appveyor.com/discussions/questions/55079-two-builds-per-commit-to-pull-request)
|
||||||
|
|||||||
@ -125,6 +125,19 @@ security reasons (e.g., Intel Software Guard Extensions (SGX)).
|
|||||||
#undef JSON_NO_IO
|
#undef JSON_NO_IO
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `JSON_SKIP_LIBRARY_VERSION_CHECK`
|
||||||
|
|
||||||
|
When defined, the library will not create a compiler warning when a different version of the library was already
|
||||||
|
included.
|
||||||
|
|
||||||
|
!!! info "Default behavior"
|
||||||
|
|
||||||
|
By default, the macro is not defined.
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#undef JSON_SKIP_LIBRARY_VERSION_CHECK
|
||||||
|
```
|
||||||
|
|
||||||
## `JSON_SKIP_UNSUPPORTED_COMPILER_CHECK`
|
## `JSON_SKIP_UNSUPPORTED_COMPILER_CHECK`
|
||||||
|
|
||||||
When defined, the library will not create a compile error when a known unsupported compiler is detected. This allows to
|
When defined, the library will not create a compile error when a known unsupported compiler is detected. This allows to
|
||||||
|
|||||||
@ -464,8 +464,7 @@ void from_json(const BasicJsonType& j, std_fs::path& p)
|
|||||||
{
|
{
|
||||||
if (JSON_HEDLEY_UNLIKELY(!j.is_string()))
|
if (JSON_HEDLEY_UNLIKELY(!j.is_string()))
|
||||||
{
|
{
|
||||||
// Not tested because of #3377 (related #3070)
|
JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()), j));
|
||||||
JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()), j)); // LCOV_EXCL_LINE
|
|
||||||
}
|
}
|
||||||
p = *j.template get_ptr<const typename BasicJsonType::string_t*>();
|
p = *j.template get_ptr<const typename BasicJsonType::string_t*>();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,14 @@ SOFTWARE.
|
|||||||
#ifndef INCLUDE_NLOHMANN_JSON_HPP_
|
#ifndef INCLUDE_NLOHMANN_JSON_HPP_
|
||||||
#define INCLUDE_NLOHMANN_JSON_HPP_
|
#define INCLUDE_NLOHMANN_JSON_HPP_
|
||||||
|
|
||||||
|
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
||||||
|
#if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
|
||||||
|
#if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 10 || NLOHMANN_JSON_VERSION_PATCH != 5
|
||||||
|
#warning "Already included a different version of the library!"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NLOHMANN_JSON_VERSION_MAJOR 3
|
#define NLOHMANN_JSON_VERSION_MAJOR 3
|
||||||
#define NLOHMANN_JSON_VERSION_MINOR 10
|
#define NLOHMANN_JSON_VERSION_MINOR 10
|
||||||
#define NLOHMANN_JSON_VERSION_PATCH 5
|
#define NLOHMANN_JSON_VERSION_PATCH 5
|
||||||
|
|||||||
@ -39,6 +39,14 @@ SOFTWARE.
|
|||||||
#ifndef INCLUDE_NLOHMANN_JSON_HPP_
|
#ifndef INCLUDE_NLOHMANN_JSON_HPP_
|
||||||
#define INCLUDE_NLOHMANN_JSON_HPP_
|
#define INCLUDE_NLOHMANN_JSON_HPP_
|
||||||
|
|
||||||
|
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
||||||
|
#if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
|
||||||
|
#if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 10 || NLOHMANN_JSON_VERSION_PATCH != 5
|
||||||
|
#warning "Already included a different version of the library!"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NLOHMANN_JSON_VERSION_MAJOR 3
|
#define NLOHMANN_JSON_VERSION_MAJOR 3
|
||||||
#define NLOHMANN_JSON_VERSION_MINOR 10
|
#define NLOHMANN_JSON_VERSION_MINOR 10
|
||||||
#define NLOHMANN_JSON_VERSION_PATCH 5
|
#define NLOHMANN_JSON_VERSION_PATCH 5
|
||||||
@ -4279,8 +4287,7 @@ void from_json(const BasicJsonType& j, std_fs::path& p)
|
|||||||
{
|
{
|
||||||
if (JSON_HEDLEY_UNLIKELY(!j.is_string()))
|
if (JSON_HEDLEY_UNLIKELY(!j.is_string()))
|
||||||
{
|
{
|
||||||
// Not tested because of #3377 (related #3070)
|
JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()), j));
|
||||||
JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()), j)); // LCOV_EXCL_LINE
|
|
||||||
}
|
}
|
||||||
p = *j.template get_ptr<const typename BasicJsonType::string_t*>();
|
p = *j.template get_ptr<const typename BasicJsonType::string_t*>();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -748,8 +748,10 @@ TEST_CASE("regression tests 2")
|
|||||||
const auto j_path = j.get<nlohmann::detail::std_fs::path>();
|
const auto j_path = j.get<nlohmann::detail::std_fs::path>();
|
||||||
CHECK(j_path == text_path);
|
CHECK(j_path == text_path);
|
||||||
|
|
||||||
// Disabled pending resolution of #3377
|
#ifndef _MSC_VER
|
||||||
// CHECK_THROWS_WITH_AS(nlohmann::detail::std_fs::path(json(1)), "[json.exception.type_error.302] type must be string, but is number", json::type_error);
|
// works everywhere but on MSVC
|
||||||
|
CHECK_THROWS_WITH_AS(nlohmann::detail::std_fs::path(json(1)), "[json.exception.type_error.302] type must be string, but is number", json::type_error);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
2
third_party/amalgamate/amalgamate.py
vendored
2
third_party/amalgamate/amalgamate.py
vendored
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
# amalgamate.py - Amalgamate C source and header files.
|
# amalgamate.py - Amalgamate C source and header files.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user