mirror of
https://github.com/nlohmann/json.git
synced 2024-07-05 13:56:59 +02:00
Merge pull request #2540 from karzhenkov/disrupt-cxx17-tests
Travis doesn't run any tests in C++17 mode
This commit is contained in:
commit
f78d456075
|
@ -210,7 +210,7 @@ matrix:
|
|||
compiler: gcc
|
||||
env:
|
||||
- COMPILER=g++-9
|
||||
- CXXFLAGS=-std=c++2a
|
||||
- CXX_STANDARD=17
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
|
@ -294,11 +294,11 @@ matrix:
|
|||
compiler: clang
|
||||
env:
|
||||
- COMPILER=clang++-7
|
||||
- CXXFLAGS=-std=c++1z
|
||||
- CXX_STANDARD=17
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7']
|
||||
packages: ['g++-6', 'clang-7', 'ninja-build']
|
||||
packages: ['g++-7', 'clang-7', 'ninja-build']
|
||||
|
||||
################
|
||||
# build script #
|
||||
|
@ -321,6 +321,9 @@ script:
|
|||
# by default, use implicit conversions
|
||||
- if [[ "${IMPLICIT_CONVERSIONS}" == "" ]]; then export IMPLICIT_CONVERSIONS=ON; fi
|
||||
|
||||
# append CXX_STANDARD to CMAKE_OPTIONS if required
|
||||
- CMAKE_OPTIONS+=${CXX_STANDARD:+ -DCMAKE_CXX_STANDARD=$CXX_STANDARD -DCMAKE_CXX_STANDARD_REQUIRED=ON}
|
||||
|
||||
# compile and execute unit tests
|
||||
- mkdir -p build && cd build
|
||||
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_ImplicitConversions=${IMPLICIT_CONVERSIONS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release
|
||||
|
|
|
@ -73,6 +73,10 @@ SOFTWARE.
|
|||
#include <nlohmann/json_fwd.hpp>
|
||||
#include <nlohmann/ordered_map.hpp>
|
||||
|
||||
#if defined(JSON_HAS_CPP_17)
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@brief namespace for Niels Lohmann
|
||||
@see https://github.com/nlohmann
|
||||
|
|
|
@ -16663,6 +16663,10 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
|
|||
} // namespace nlohmann
|
||||
|
||||
|
||||
#if defined(JSON_HAS_CPP_17)
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@brief namespace for Niels Lohmann
|
||||
@see https://github.com/nlohmann
|
||||
|
|
|
@ -48,10 +48,6 @@ using nlohmann::json;
|
|||
#define JSON_HAS_CPP_14
|
||||
#endif
|
||||
|
||||
#if defined(JSON_HAS_CPP_17)
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
TEST_CASE("value conversion")
|
||||
{
|
||||
SECTION("get an object (explicit)")
|
||||
|
|
Loading…
Reference in a new issue