Unverified Commit f78d4560 authored by Niels Lohmann's avatar Niels Lohmann Committed by GitHub

Merge pull request #2540 from karzhenkov/disrupt-cxx17-tests

Travis doesn't run any tests in C++17 mode
parents c3c574cf 9493f4be
...@@ -210,7 +210,7 @@ matrix: ...@@ -210,7 +210,7 @@ matrix:
compiler: gcc compiler: gcc
env: env:
- COMPILER=g++-9 - COMPILER=g++-9
- CXXFLAGS=-std=c++2a - CXX_STANDARD=17
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
...@@ -294,11 +294,11 @@ matrix: ...@@ -294,11 +294,11 @@ matrix:
compiler: clang compiler: clang
env: env:
- COMPILER=clang++-7 - COMPILER=clang++-7
- CXXFLAGS=-std=c++1z - CXX_STANDARD=17
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7'] 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 # # build script #
...@@ -321,6 +321,9 @@ script: ...@@ -321,6 +321,9 @@ script:
# by default, use implicit conversions # by default, use implicit conversions
- if [[ "${IMPLICIT_CONVERSIONS}" == "" ]]; then export IMPLICIT_CONVERSIONS=ON; fi - 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 # compile and execute unit tests
- mkdir -p build && cd build - mkdir -p build && cd build
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_ImplicitConversions=${IMPLICIT_CONVERSIONS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release - cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_ImplicitConversions=${IMPLICIT_CONVERSIONS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release
......
...@@ -73,6 +73,10 @@ SOFTWARE. ...@@ -73,6 +73,10 @@ SOFTWARE.
#include <nlohmann/json_fwd.hpp> #include <nlohmann/json_fwd.hpp>
#include <nlohmann/ordered_map.hpp> #include <nlohmann/ordered_map.hpp>
#if defined(JSON_HAS_CPP_17)
#include <string_view>
#endif
/*! /*!
@brief namespace for Niels Lohmann @brief namespace for Niels Lohmann
@see https://github.com/nlohmann @see https://github.com/nlohmann
......
...@@ -16663,6 +16663,10 @@ template <class Key, class T, class IgnoredLess = std::less<Key>, ...@@ -16663,6 +16663,10 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
} // namespace nlohmann } // namespace nlohmann
#if defined(JSON_HAS_CPP_17)
#include <string_view>
#endif
/*! /*!
@brief namespace for Niels Lohmann @brief namespace for Niels Lohmann
@see https://github.com/nlohmann @see https://github.com/nlohmann
......
...@@ -48,10 +48,6 @@ using nlohmann::json; ...@@ -48,10 +48,6 @@ using nlohmann::json;
#define JSON_HAS_CPP_14 #define JSON_HAS_CPP_14
#endif #endif
#if defined(JSON_HAS_CPP_17)
#include <string_view>
#endif
TEST_CASE("value conversion") TEST_CASE("value conversion")
{ {
SECTION("get an object (explicit)") SECTION("get an object (explicit)")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment