From c1642affaa0fdb8112409f4ce0addaa3457a4ee1 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:03:35 +0200 Subject: [PATCH 01/24] :construction_worker: clang-3.8 --- .travis.yml | 291 ++-------------------------------------------------- 1 file changed, 6 insertions(+), 285 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3d1677d0..775235c36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,293 +28,22 @@ env: matrix: include: - # Valgrind - - os: linux compiler: gcc - env: - - COMPILER=g++-4.9 - - SPECIAL=valgrind + env: COMPILER=clang-3.8 addons: apt: - sources: ['ubuntu-toolchain-r-test'] - packages: [g++-4.9, valgrind] - after_success: - - make check TEST_PREFIX="valgrind --error-exitcode=1 --leak-check=full " TEST_PATTERN="" - - # cLang sanitizer - # note: sadly clang's libc++ has errors when running with sanitize, - # so we use clang with gcc's libstdc++ which doesn't give those error. - # that's why we need to install g++-6 to get the lastest version - - os: linux - env: - - LLVM_VERSION=3.8.1 - - SPECIAL=sanitizer - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: g++-6 - compiler: clang - before_script: - - make clang_sanitize - - # cppcheck - - - os: linux - compiler: gcc - env: - - COMPILER=g++-4.9 - - SPECIAL=cppcheck - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: [g++-4.9, cppcheck] - after_success: - - make cppcheck - - # no exceptions - - - os: linux - compiler: gcc - env: - - COMPILER=g++-4.9 - - SPECIAL=no_exceptions - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: [g++-4.9, cppcheck] - after_success: - - make clean - - CPPFLAGS="-DJSON_NOEXCEPTION" make check TEST_PATTERN="-e \"*\"" - - # Coveralls (http://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/) - - - os: linux - compiler: gcc - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-4.9', 'ruby'] - before_script: - - wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz - - tar xf lcov_1.11.orig.tar.gz - - sudo make -C lcov-1.11/ install - - gem install coveralls-lcov - - pip install --user cpp-coveralls - after_success: - - make clean - - CXXFLAGS="--coverage -g -O0" CPPFLAGS="-DNDEBUG" make json_unit - - test/json_unit "*" - - coveralls --build-root test --exclude src/catch.hpp --exclude src/unit-algorithms.cpp --exclude src/unit-allocator.cpp --exclude src/unit-capacity.cpp --exclude src/unit-class_const_iterator.cpp --exclude src/unit-class_iterator.cpp --exclude src/unit-class_lexer.cpp --exclude src/unit-class_parser.cpp --exclude src/unit-comparison.cpp --exclude src/unit-concepts.cpp --exclude src/unit-constructor1.cpp --exclude src/unit-constructor2.cpp --exclude src/unit-convenience.cpp --exclude src/unit-conversions.cpp --exclude src/unit-deserialization.cpp --exclude src/unit-element_access1.cpp --exclude src/unit-element_access2.cpp --exclude src/unit-inspection.cpp --exclude src/unit-iterator_wrapper.cpp --exclude src/unit-iterators1.cpp --exclude src/unit-iterators2.cpp --exclude src/unit-json_patch.cpp --exclude src/unit-json_pointer.cpp --exclude src/unit-modifiers.cpp --exclude src/unit-pointer_access.cpp --exclude src/unit-readme.cpp --exclude src/unit-reference_access.cpp --exclude src/unit-regression.cpp --exclude src/unit-serialization.cpp --exclude src/unit-testsuites.cpp --exclude src/unit-unicode.cpp --include ../src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9' - - lcov --directory src --directory test/src --capture --output-file coverage.info --rc lcov_branch_coverage=1 --no-external - - lcov --remove coverage.info 'test/src/*' --output-file coverage.info --rc lcov_branch_coverage=1 - - lcov --list coverage.info --rc lcov_branch_coverage=1 - - coveralls-lcov --repo-token F9bs4Nop10JRgqPQXRcifyQKYhb3FczkS coverage.info - env: - - COMPILER=g++-4.9 - - SPECIAL=coveralls - - # Coverity (only for branch coverity_scan) - - - os: linux - compiler: clang - before_install: echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt - addons: - coverity_scan: - project: - name: "nlohmann/json" - description: "Build submitted via Travis CI" - notification_email: niels.lohmann@gmail.com - build_command_prepend: "make clean" - build_command: "make" - branch_pattern: coverity_scan - env: - - LLVM_VERSION=3.6.0 - - SPECIAL=coverity - - # OSX / Clang - - - os: osx - osx_image: xcode6.4 - - - os: osx - osx_image: xcode7.3 - - - os: osx - osx_image: xcode8 - - - os: osx - osx_image: xcode8.1 - - - os: osx - osx_image: xcode8.2 - - - os: osx - osx_image: xcode8.3 - - - os: osx - osx_image: xcode9 - - # Linux / GCC - - - os: linux - compiler: gcc - env: COMPILER=g++-4.9 - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: g++-4.9 - - - os: linux - compiler: gcc - env: COMPILER=g++-5 - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: g++-5 - - - os: linux - compiler: gcc - env: COMPILER=g++-6 - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: g++-6 - - - os: linux - compiler: gcc - env: COMPILER=g++-7 - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: g++-7 - - - os: linux - compiler: gcc - env: - - COMPILER=g++-7 - - CXXFLAGS=-std=c++17 - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: g++-7 - - # Linux / Clang - - - os: linux - env: LLVM_VERSION=3.6.0 - compiler: clang - - - os: linux - env: LLVM_VERSION=3.6.1 - compiler: clang - - - os: linux - env: LLVM_VERSION=3.6.2 - compiler: clang - -# - os: linux -# env: LLVM_VERSION=3.7.0 -# compiler: clang - -# - os: linux -# env: LLVM_VERSION=3.7.1 -# compiler: clang - - - os: linux - env: LLVM_VERSION=3.8.0 - compiler: clang - - - os: linux - env: LLVM_VERSION=3.8.1 - compiler: clang - -# - os: linux -# addons: -# apt: -# sources: llvm-toolchain-trusty-3.9 -# packages: clang-3.9 -# env: COMPILER=clang++-3.9 -# -# - os: linux -# addons: -# apt: -# sources: llvm-toolchain-trusty-4.0 -# packages: clang-4.0 -# env: COMPILER=clang++-4.0 -# -# - os: linux -# addons: -# apt: -# sources: llvm-toolchain-trusty -# packages: clang-5.0 -# env: COMPILER=clang++-5.0 - -##################### -# installation step # -##################### - -# set directories to cache -cache: - directories: - - ${TRAVIS_BUILD_DIR}/deps/llvm-3.6.2 - - ${TRAVIS_BUILD_DIR}/deps/llvm-3.6.1 - - ${TRAVIS_BUILD_DIR}/deps/llvm-3.6.0 - - ${TRAVIS_BUILD_DIR}/deps/llvm-3.7.0 - - ${TRAVIS_BUILD_DIR}/deps/llvm-3.7.1 - - ${TRAVIS_BUILD_DIR}/deps/llvm-3.8.0 - - ${TRAVIS_BUILD_DIR}/deps/llvm-3.8.1 - - -install: - # create deps dir if not existing - - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - - mkdir -p ${DEPS_DIR} - - # make sure CXX is correctly set - - if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi - - # get CMake (only for systems with brew - macOS) - - | - if [[ !(-x $(which cmake)) && (-x $(which brew)) ]]; then - brew update - brew install cmake - cmake --version - fi - - # install LLVM/clang when LLVM_VERSION is set - - | - if [[ "${LLVM_VERSION}" != "" ]]; then - LLVM_DIR=${DEPS_DIR}/llvm-${LLVM_VERSION} - if [[ -z "$(ls -A ${LLVM_DIR})" ]]; then - travis_retry wget --quiet https://cmake.org/files/v3.6/cmake-3.6.1.tar.gz - tar xfz cmake-3.6.1.tar.gz - (cd cmake-3.6.1 && ./configure --prefix=${LLVM_DIR}/cmake && make install) - export PATH="${LLVM_DIR}/cmake/bin:${PATH}" - LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz" - LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz" - LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz" - CLANG_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz" - mkdir -p ${LLVM_DIR} ${LLVM_DIR}/build ${LLVM_DIR}/projects/libcxx ${LLVM_DIR}/projects/libcxxabi ${LLVM_DIR}/clang - travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR} - travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxx - travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxxabi - travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/clang - (cd ${LLVM_DIR}/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}/install -DCMAKE_CXX_COMPILER=clang++) - (cd ${LLVM_DIR}/build/projects/libcxx && make install -j2) - (cd ${LLVM_DIR}/build/projects/libcxxabi && make install -j2) - fi - export CXXFLAGS="-nostdinc++ -isystem ${LLVM_DIR}/install/include/c++/v1" - export LDFLAGS="-L ${LLVM_DIR}/install/lib -l c++ -l c++abi" - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_DIR}/install/lib" - export PATH="${LLVM_DIR}/clang/bin:${PATH}" - fi + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8'] + packages: ['g++-6', 'clang-3.8'] ################ # build script # ################ script: + # make sure CXX is correctly set + - if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi + # show OS/compiler version - uname -a - $CXX --version @@ -324,11 +53,3 @@ script: - cmake .. && cmake --build . --config Release -- -j4 - ctest -C Release -V - cd .. - - # check if homebrew works (only checks develop branch) - - if [ `which brew` ]; then - brew update ; - brew tap nlohmann/json ; - brew install nlohmann_json --HEAD ; - brew test nlohmann_json ; - fi From eb6de822bb0beb4f2d208bea7995ff72bb47c395 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:12:04 +0200 Subject: [PATCH 02/24] :construction_worker: clang-3.7 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 775235c36..822cd1206 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,8 +33,8 @@ matrix: env: COMPILER=clang-3.8 addons: apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8'] - packages: ['g++-6', 'clang-3.8'] + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-3.7'] + packages: ['g++-6', 'clang-3.7'] ################ # build script # From e3335626338aea6d5cb2e6ef9514ac4598e40e48 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:15:16 +0200 Subject: [PATCH 03/24] :construction_worker: different source --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 822cd1206..b7125e162 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ matrix: env: COMPILER=clang-3.8 addons: apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-3.7'] + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7'] packages: ['g++-6', 'clang-3.7'] ################ From e7a7e4f81f736baaf52c6ba95993677b607ca272 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:18:45 +0200 Subject: [PATCH 04/24] :construction_worker: fixed compiler --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7125e162..ede6406d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,8 +29,8 @@ matrix: include: - os: linux - compiler: gcc - env: COMPILER=clang-3.8 + compiler: clang + env: COMPILER=clang-3.7 addons: apt: sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7'] From 5aceb0e029fd4e3862dacc7b6c77a1d380d61d47 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:23:55 +0200 Subject: [PATCH 05/24] :construction_worker: clang-3.6 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ede6406d8..fe32c6461 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,11 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang-3.7 + env: COMPILER=clang-3.6 addons: apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7'] - packages: ['g++-6', 'clang-3.7'] + sources: ['ubuntu-toolchain-r-test''] + packages: ['g++-6', 'clang-3.6'] ################ # build script # From 8963aae57d83f51d6f5d56eddadf05476b12ef71 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:24:36 +0200 Subject: [PATCH 06/24] :construction_worker: clang-3.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fe32c6461..f96eecb99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ matrix: env: COMPILER=clang-3.6 addons: apt: - sources: ['ubuntu-toolchain-r-test''] + sources: ['ubuntu-toolchain-r-test'] packages: ['g++-6', 'clang-3.6'] ################ From 94dfecd4873d35bc5e590a8a34394cca6c71519e Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:31:43 +0200 Subject: [PATCH 07/24] :construction_worker: removed g++ --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f96eecb99..edf4970b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,8 +33,7 @@ matrix: env: COMPILER=clang-3.6 addons: apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-6', 'clang-3.6'] + packages: ['clang-3.6'] ################ # build script # From c20dd7522f552dd0f28e916f1b73302d4c8af370 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:40:09 +0200 Subject: [PATCH 08/24] :construction_worker: another try --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index edf4970b1..6165441d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,8 @@ matrix: env: COMPILER=clang-3.6 addons: apt: - packages: ['clang-3.6'] + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6'] + packages: ['g++-6', 'clang-3.6'] ################ # build script # From 3283352db3f7ceedc849bd74a27b077c2dd902df Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:45:33 +0200 Subject: [PATCH 09/24] :construction_worker: using clang++ --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6165441d7..a7d42d673 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang-3.6 + env: COMPILER=clang++-3.6 addons: apt: sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6'] From c06b5c5c10136d95f8964414d0a0a62354deebc8 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:50:36 +0200 Subject: [PATCH 10/24] :construction_worker: clang-3.5 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a7d42d673..41bc22151 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,11 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang++-3.6 + env: COMPILER=clang++-3.5 addons: apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6'] - packages: ['g++-6', 'clang-3.6'] + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5'] + packages: ['g++-6', 'clang-3.5'] ################ # build script # From f256587c4f2e07679f6c2ddc3d05f8b8a1a5d1bc Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:56:09 +0200 Subject: [PATCH 11/24] :construction_worker: clang-3.4 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 41bc22151..943609615 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,11 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang++-3.5 + env: COMPILER=clang++-3.4 addons: apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5'] - packages: ['g++-6', 'clang-3.5'] + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.4'] + packages: ['g++-6', 'clang-3.4'] ################ # build script # From 82cd8c8d02d4523c4f6ccd70d5bf7ce09b40858f Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 19:59:00 +0200 Subject: [PATCH 12/24] :construction_worker: another try --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 943609615..26fc74923 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ matrix: env: COMPILER=clang++-3.4 addons: apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.4'] + sources: ['ubuntu-toolchain-r-test'] packages: ['g++-6', 'clang-3.4'] ################ From 6b20f6d1efce2b7be3a05e9b583b432da846f420 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:04:36 +0200 Subject: [PATCH 13/24] :construction_worker: clang-3.8 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26fc74923..bea857dae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,11 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang++-3.4 + env: COMPILER=clang++-3.8 addons: apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-6', 'clang-3.4'] + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-3.8'] + packages: ['g++-6', 'clang-3.8'] ################ # build script # From e7f2d2646a898a19c70e3d2e647e1e91b2608999 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:06:47 +0200 Subject: [PATCH 14/24] :construction_worker: removed gcc --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bea857dae..66211c9fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,8 +33,7 @@ matrix: env: COMPILER=clang++-3.8 addons: apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-3.8'] - packages: ['g++-6', 'clang-3.8'] + packages: ['clang-3.8'] ################ # build script # From 195d773bc5a33b1a908eb3f19f13fd0d00402b7c Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:09:39 +0200 Subject: [PATCH 15/24] :construction_worker: added gcc --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 66211c9fb..3e544b665 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ matrix: env: COMPILER=clang++-3.8 addons: apt: - packages: ['clang-3.8'] + packages: ['g++-6', 'clang-3.8'] ################ # build script # From 8de710bbe7cc0a882c507017791081a2913bea06 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:12:27 +0200 Subject: [PATCH 16/24] :construction_worker: added source for gcc --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3e544b665..7acc7cb46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ matrix: env: COMPILER=clang++-3.8 addons: apt: + sources: ['ubuntu-toolchain-r-test'] packages: ['g++-6', 'clang-3.8'] ################ From 6dc89e47fce58cedd61f7d8d1b0537cf6fb83c69 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:16:35 +0200 Subject: [PATCH 17/24] :construction_worker: clang-3.9 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7acc7cb46..ae923a0f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,11 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang++-3.8 + env: COMPILER=clang++-3.9 addons: apt: sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-6', 'clang-3.8'] + packages: ['g++-6', 'clang-3.9'] ################ # build script # From e0f8eb171079082dc993756b440c06350323cfd8 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:21:41 +0200 Subject: [PATCH 18/24] :construction_worker: clang-4.0 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ae923a0f8..2a737749e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,11 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang++-3.9 + env: COMPILER=clang++-4.0 addons: apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-6', 'clang-3.9'] + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0'] + packages: ['g++-6', 'clang-4.0'] ################ # build script # From f49356e7031e32c3dce3342c4bf07a2312083113 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:26:49 +0200 Subject: [PATCH 19/24] :construction_worker: clang-3.4 --- .travis.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a737749e..aee42cd3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,19 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang++-4.0 + env: COMPILER=clang++-3.4 addons: apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0'] - packages: ['g++-6', 'clang-4.0'] + sources: ['ubuntu-toolchain-r-test'] + packages: ['g++-6', 'clang-3.4'] + + - os: linux + compiler: clang + env: COMPILER=clang++-3.5 + addons: + apt: + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5'] + packages: ['g++-6', 'clang-3.5'] ################ # build script # From 5eb9f5fd4f0bde6f6bc312545521fd02db9a9b5e Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:31:59 +0200 Subject: [PATCH 20/24] :construction_worker: clang-3.4 --- .travis.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index aee42cd3a..405a25872 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,19 +30,10 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang++-3.4 + env: COMPILER=clang++ addons: apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-6', 'clang-3.4'] - - - os: linux - compiler: clang - env: COMPILER=clang++-3.5 - addons: - apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5'] - packages: ['g++-6', 'clang-3.5'] + packages: ['clang-3.4'] ################ # build script # From cd34358e7c6bba263a30055a6f29d274c616173e Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:37:23 +0200 Subject: [PATCH 21/24] :construction_worker: removing clang from source --- .travis.yml | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 225 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 405a25872..8619bdc1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,12 +28,226 @@ env: matrix: include: + # Valgrind + - os: linux - compiler: clang - env: COMPILER=clang++ + compiler: gcc + env: + - COMPILER=g++-4.9 + - SPECIAL=valgrind addons: apt: - packages: ['clang-3.4'] + sources: ['ubuntu-toolchain-r-test'] + packages: [g++-4.9, valgrind] + after_success: + - make check TEST_PREFIX="valgrind --error-exitcode=1 --leak-check=full " TEST_PATTERN="" + + # cLang sanitizer + # note: sadly clang's libc++ has errors when running with sanitize, + # so we use clang with gcc's libstdc++ which doesn't give those error. + # that's why we need to install g++-6 to get the lastest version + - os: linux + env: + - LLVM_VERSION=3.8.1 + - SPECIAL=sanitizer + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: g++-6 + compiler: clang + before_script: + - make clang_sanitize + + # cppcheck + + - os: linux + compiler: gcc + env: + - COMPILER=g++-4.9 + - SPECIAL=cppcheck + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: [g++-4.9, cppcheck] + after_success: + - make cppcheck + + # no exceptions + + - os: linux + compiler: gcc + env: + - COMPILER=g++-4.9 + - SPECIAL=no_exceptions + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: [g++-4.9, cppcheck] + after_success: + - make clean + - CPPFLAGS="-DJSON_NOEXCEPTION" make check TEST_PATTERN="-e \"*\"" + + # Coveralls (http://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/) + + - os: linux + compiler: gcc + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: ['g++-4.9', 'ruby'] + before_script: + - wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz + - tar xf lcov_1.11.orig.tar.gz + - sudo make -C lcov-1.11/ install + - gem install coveralls-lcov + - pip install --user cpp-coveralls + after_success: + - make clean + - CXXFLAGS="--coverage -g -O0" CPPFLAGS="-DNDEBUG" make json_unit + - test/json_unit "*" + - coveralls --build-root test --exclude src/catch.hpp --exclude src/unit-algorithms.cpp --exclude src/unit-allocator.cpp --exclude src/unit-capacity.cpp --exclude src/unit-class_const_iterator.cpp --exclude src/unit-class_iterator.cpp --exclude src/unit-class_lexer.cpp --exclude src/unit-class_parser.cpp --exclude src/unit-comparison.cpp --exclude src/unit-concepts.cpp --exclude src/unit-constructor1.cpp --exclude src/unit-constructor2.cpp --exclude src/unit-convenience.cpp --exclude src/unit-conversions.cpp --exclude src/unit-deserialization.cpp --exclude src/unit-element_access1.cpp --exclude src/unit-element_access2.cpp --exclude src/unit-inspection.cpp --exclude src/unit-iterator_wrapper.cpp --exclude src/unit-iterators1.cpp --exclude src/unit-iterators2.cpp --exclude src/unit-json_patch.cpp --exclude src/unit-json_pointer.cpp --exclude src/unit-modifiers.cpp --exclude src/unit-pointer_access.cpp --exclude src/unit-readme.cpp --exclude src/unit-reference_access.cpp --exclude src/unit-regression.cpp --exclude src/unit-serialization.cpp --exclude src/unit-testsuites.cpp --exclude src/unit-unicode.cpp --include ../src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9' + - lcov --directory src --directory test/src --capture --output-file coverage.info --rc lcov_branch_coverage=1 --no-external + - lcov --remove coverage.info 'test/src/*' --output-file coverage.info --rc lcov_branch_coverage=1 + - lcov --list coverage.info --rc lcov_branch_coverage=1 + - coveralls-lcov --repo-token F9bs4Nop10JRgqPQXRcifyQKYhb3FczkS coverage.info + env: + - COMPILER=g++-4.9 + - SPECIAL=coveralls + + # Coverity (only for branch coverity_scan) + + - os: linux + compiler: clang + before_install: echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt + addons: + coverity_scan: + project: + name: "nlohmann/json" + description: "Build submitted via Travis CI" + notification_email: niels.lohmann@gmail.com + build_command_prepend: "make clean" + build_command: "make" + branch_pattern: coverity_scan + env: + - LLVM_VERSION=3.6.0 + - SPECIAL=coverity + + # OSX / Clang + + - os: osx + osx_image: xcode6.4 + + - os: osx + osx_image: xcode7.3 + + - os: osx + osx_image: xcode8 + + - os: osx + osx_image: xcode8.1 + + - os: osx + osx_image: xcode8.2 + + - os: osx + osx_image: xcode8.3 + + - os: osx + osx_image: xcode9 + + # Linux / GCC + + - os: linux + compiler: gcc + env: COMPILER=g++-4.9 + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: g++-4.9 + + - os: linux + compiler: gcc + env: COMPILER=g++-5 + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: g++-5 + + - os: linux + compiler: gcc + env: COMPILER=g++-6 + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: g++-6 + + - os: linux + compiler: gcc + env: COMPILER=g++-7 + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: g++-7 + + - os: linux + compiler: gcc + env: + - COMPILER=g++-7 + - CXXFLAGS=-std=c++17 + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: g++-7 + + # Linux / Clang + + - os: linux + compiler: clang + env: COMPILER=clang++-3.5 + addons: + apt: + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5'] + packages: ['g++-6', 'clang-3.5'] + + - os: linux + compiler: clang + env: COMPILER=clang++-3.6 + addons: + apt: + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6'] + packages: ['g++-6', 'clang-3.6'] + + - os: linux + compiler: clang + env: COMPILER=clang++-3.7 + addons: + apt: + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7'] + packages: ['g++-6', 'clang-3.7'] + + - os: linux + compiler: clang + env: COMPILER=clang++-3.8 + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: ['g++-6', 'clang-3.8'] + + - os: linux + compiler: clang + env: COMPILER=clang++-3.9 + addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: ['g++-6', 'clang-3.9'] + + - os: linux + compiler: clang + env: COMPILER=clang++-4.0 + addons: + apt: + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0'] + packages: ['g++-6', 'clang-4.0'] ################ # build script # @@ -52,3 +266,11 @@ script: - cmake .. && cmake --build . --config Release -- -j4 - ctest -C Release -V - cd .. + + # check if homebrew works (only checks develop branch) + - if [ `which brew` ]; then + brew update ; + brew tap nlohmann/json ; + brew install nlohmann_json --HEAD ; + brew test nlohmann_json ; + fi From 76b195d7d12650c48ac673871e8b6f5a1665c1ec Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 20:54:59 +0200 Subject: [PATCH 22/24] :construction_worker: fix for coverity + clang-5.0 --- .travis.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8619bdc1b..e36e9cd16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -120,6 +120,9 @@ matrix: compiler: clang before_install: echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt addons: + apt: + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6'] + packages: ['g++-6', 'clang-3.6'] coverity_scan: project: name: "nlohmann/json" @@ -129,8 +132,8 @@ matrix: build_command: "make" branch_pattern: coverity_scan env: - - LLVM_VERSION=3.6.0 - SPECIAL=coverity + - COMPILER=clang++-3.6 # OSX / Clang @@ -249,6 +252,14 @@ matrix: sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0'] packages: ['g++-6', 'clang-4.0'] + - os: linux + compiler: clang + env: COMPILER=clang++-5.0 + addons: + apt: + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty'] + packages: ['g++-6', 'clang-5.0'] + ################ # build script # ################ From bade3b3e6c33581d119a194f3ca80b4eb42f0d2a Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 21:17:40 +0200 Subject: [PATCH 23/24] :construction_worker: cleanup --- .travis.yml | 8 +++++--- README.md | 15 +++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index e36e9cd16..922bb7df6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -254,11 +254,13 @@ matrix: - os: linux compiler: clang - env: COMPILER=clang++-5.0 + env: + - COMPILER=clang++-4.0 + - CXXFLAGS=-std=c++17 addons: apt: - sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty'] - packages: ['g++-6', 'clang-5.0'] + sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0'] + packages: ['g++-6', 'clang-4.0'] ################ # build script # diff --git a/README.md b/README.md index fcfe58cae..92d1956a5 100644 --- a/README.md +++ b/README.md @@ -712,7 +712,7 @@ json j_from_msgpack = json::from_msgpack(v_msgpack); Though it's 2016 already, the support for C++11 is still a bit sparse. Currently, the following compilers are known to work: - GCC 4.9 - 7.1 (and possibly later) -- Clang 3.4 - 3.9 (and possibly later) +- Clang 3.4 - 4.0 (and possibly later) - Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later) - Microsoft Visual C++ 2017 / Build Tools 15.1.548.43366 (and possibly later) @@ -741,13 +741,12 @@ The following compilers are currently used in continuous integration at [Travis] | GCC 5.4.1 | Ubuntu 14.04.5 LTS | g++-5 (Ubuntu 5.4.1-2ubuntu1~14.04) 5.4.1 20160904 | | GCC 6.3.0 | Ubuntu 14.04.5 LTS | g++-6 (Ubuntu/Linaro 6.3.0-18ubuntu2~14.04) 6.3.0 20170519 | | GCC 7.1.0 | Ubuntu 14.04.5 LTS | g++-7 (Ubuntu 7.1.0-5ubuntu2~14.04) 7.1.0 -| Clang 3.6.0 | Ubuntu 14.04.5 LTS | clang version 3.6.0 (tags/RELEASE_360/final) | -| Clang 3.6.1 | Ubuntu 14.04.5 LTS | clang version 3.6.1 (tags/RELEASE_361/final) | -| Clang 3.6.2 | Ubuntu 14.04.5 LTS | clang version 3.6.2 (tags/RELEASE_362/final) | -| Clang 3.7.0 | Ubuntu 14.04.5 LTS | clang version 3.7.0 (tags/RELEASE_370/final) | -| Clang 3.7.1 | Ubuntu 14.04.5 LTS | clang version 3.7.1 (tags/RELEASE_371/final) | -| Clang 3.8.0 | Ubuntu 14.04.5 LTS | clang version 3.8.0 (tags/RELEASE_380/final) | -| Clang 3.8.1 | Ubuntu 14.04.5 LTS | clang version 3.8.1 (tags/RELEASE_381/final) | +| Clang 3.5.0 | Ubuntu 14.04.5 LTS | clang version 3.5.0-4ubuntu2~trusty2 (tags/RELEASE_350/final) | +| Clang 3.6.2 | Ubuntu 14.04.5 LTS | clang version 3.6.2-svn240577-1~exp1 (branches/release_36) | +| Clang 3.7.1 | Ubuntu 14.04.5 LTS | clang version 3.7.1-svn253571-1~exp1 (branches/release_37) | +| Clang 3.8.0 | Ubuntu 14.04.5 LTS | clang version 3.8.0-2ubuntu3~trusty5 (tags/RELEASE_380/final) | +| Clang 3.9.1 | Ubuntu 14.04.5 LTS | clang version 3.9.1-4ubuntu3~14.04.2 (tags/RELEASE_391/rc2) | +| Clang 4.0.1 | Ubuntu 14.04.5 LTS | clang version 4.0.1-svn305264-1~exp1 (branches/release_40) | | Clang Xcode 6.4 | Darwin Kernel Version 14.3.0 (OSX 10.10.3) | Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) | | Clang Xcode 7.3 | Darwin Kernel Version 15.0.0 (OSX 10.10.5) | Apple LLVM version 7.3.0 (clang-703.0.29) | | Clang Xcode 8.0 | Darwin Kernel Version 15.6.0 | Apple LLVM version 8.0.0 (clang-800.0.38) | From 569c00eb18269d8a53973cbe06f344bc7bdffc1d Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 10 Aug 2017 23:41:12 +0200 Subject: [PATCH 24/24] :construction_worker: changed c++17 to c++1z --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 922bb7df6..7969af188 100644 --- a/.travis.yml +++ b/.travis.yml @@ -256,7 +256,7 @@ matrix: compiler: clang env: - COMPILER=clang++-4.0 - - CXXFLAGS=-std=c++17 + - CXXFLAGS=-std=c++1z addons: apt: sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']