mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Moved CI from Travis to GitHub Actions (fixes #1493)
This commit is contained in:
		
							
								
								
									
										252
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										252
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,252 @@ | |||||||
|  | name: Continuous Integration | ||||||
|  |  | ||||||
|  | on: [push, pull_request] | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   gcc: | ||||||
|  |     name: GCC | ||||||
|  |     runs-on: ubuntu-20.04 | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         include: | ||||||
|  |           - gcc: '4.4' | ||||||
|  |           - gcc: '4.6' | ||||||
|  |           - gcc: '4.7' | ||||||
|  |           - gcc: '4.8' | ||||||
|  |           - gcc: '4.9' | ||||||
|  |           - gcc: '5' | ||||||
|  |           - gcc: '6' | ||||||
|  |           - gcc: '7' | ||||||
|  |             cxxflags: -fsanitize=leak | ||||||
|  |           - gcc: '8' | ||||||
|  |             cxxflags: -fsanitize=undefined | ||||||
|  |           - gcc: '9' | ||||||
|  |             cxxflags: -fsanitize=address | ||||||
|  |           - gcc: '10' | ||||||
|  |     steps: | ||||||
|  |       - name: Install | ||||||
|  |         run: | | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty main' | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty universe' | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial main' | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial universe'  | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic main' | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic universe'  | ||||||
|  |           sudo apt-get update | ||||||
|  |           sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} | ||||||
|  |         if: ${{ matrix.gcc < 7 }} | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Configure | ||||||
|  |         run: cmake -DCMAKE_BUILD_TYPE=Debug . | ||||||
|  |         env: | ||||||
|  |           CC: gcc-${{ matrix.gcc }} | ||||||
|  |           CXX: g++-${{ matrix.gcc }} | ||||||
|  |           CXXFLAGS: ${{ matrix.cxxflags }} | ||||||
|  |       - name: Build | ||||||
|  |         run: cmake --build . | ||||||
|  |       - name: Test | ||||||
|  |         run: ctest --output-on-failure -C Debug . | ||||||
|  |  | ||||||
|  |   clang: | ||||||
|  |     name: Clang | ||||||
|  |     runs-on: ubuntu-20.04 | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         include: | ||||||
|  |           - clang: '3.5' | ||||||
|  |           - clang: '3.6' | ||||||
|  |           - clang: '3.7' | ||||||
|  |           - clang: '3.8' | ||||||
|  |           - clang: '3.9' | ||||||
|  |           - clang: '4.0' | ||||||
|  |           - clang: '5.0' | ||||||
|  |           - clang: '6.0' | ||||||
|  |           - clang: '7' | ||||||
|  |           - clang: '8' | ||||||
|  |             cxxflags: -fsanitize=leak | ||||||
|  |           - clang: '9' | ||||||
|  |             cxxflags: -fsanitize=undefined | ||||||
|  |           - clang: '10' | ||||||
|  |             cxxflags: -fsanitize=address | ||||||
|  |     steps: | ||||||
|  |       - name: Install | ||||||
|  |         run: | | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty main' | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty universe' | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial main' | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial universe'  | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic main' | ||||||
|  |           sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic universe'  | ||||||
|  |           sudo apt-get update | ||||||
|  |           sudo apt-get install -y clang-${{ matrix.clang }} | ||||||
|  |         if: ${{ matrix.clang < 8 }} | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Configure | ||||||
|  |         run: cmake -DCMAKE_BUILD_TYPE=Debug . | ||||||
|  |         env: | ||||||
|  |           CC: clang-${{ matrix.clang }} | ||||||
|  |           CXX: clang++-${{ matrix.clang }} | ||||||
|  |           CXXFLAGS: ${{ matrix.cxxflags }}           | ||||||
|  |       - name: Build | ||||||
|  |         run: cmake --build . | ||||||
|  |       - name: Test | ||||||
|  |         run: ctest --output-on-failure -C Debug . | ||||||
|  |  | ||||||
|  |   xcode: | ||||||
|  |     name: XCode | ||||||
|  |     needs: clang | ||||||
|  |     runs-on: macos-10.15 | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         include: | ||||||
|  |           - xcode: '10.3'           | ||||||
|  |           - xcode: '11.7' | ||||||
|  |           - xcode: '12.4' | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Select XCode version | ||||||
|  |         run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app | ||||||
|  |       - name: Configure | ||||||
|  |         run: cmake -DCMAKE_BUILD_TYPE=Debug . | ||||||
|  |       - name: Build | ||||||
|  |         run: cmake --build . | ||||||
|  |       - name: Test | ||||||
|  |         run: ctest --output-on-failure -C Debug . | ||||||
|  |  | ||||||
|  |   # DISABLED: Running on AppVeyor instead because it supports older versions of the compiler | ||||||
|  |   # msvc: | ||||||
|  |   #   name: Visual Studio | ||||||
|  |   #   strategy: | ||||||
|  |   #     fail-fast: false | ||||||
|  |   #     matrix: | ||||||
|  |   #       include: | ||||||
|  |   #         - os: windows-2016 | ||||||
|  |   #         - os: windows-2019 | ||||||
|  |   #   runs-on: ${{ matrix.os }} | ||||||
|  |   #   steps: | ||||||
|  |   #     - name: Checkout | ||||||
|  |   #       uses: actions/checkout@v2 | ||||||
|  |   #     - name: Configure | ||||||
|  |   #       run: cmake -DCMAKE_BUILD_TYPE=Debug . | ||||||
|  |   #     - name: Build | ||||||
|  |   #       run: cmake --build . | ||||||
|  |   #     - name: Test | ||||||
|  |   #       run: ctest --output-on-failure -C Debug . | ||||||
|  |  | ||||||
|  |   arduino: | ||||||
|  |     name: Arduino | ||||||
|  |     needs: gcc | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         include: | ||||||
|  |           - arduino: '1.6.7' | ||||||
|  |             board: arduino:avr:uno | ||||||
|  |           - arduino: '1.8.2' | ||||||
|  |             board: arduino:samd:mkr1000 | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Build | ||||||
|  |         run: extras/ci/arduino.sh ${{ matrix.board }} | ||||||
|  |         env: | ||||||
|  |            BOARD: ${{ matrix.board }} | ||||||
|  |            VERSION: ${{ matrix.arduino }} | ||||||
|  |  | ||||||
|  |   platformio: | ||||||
|  |     name: PlatformIO | ||||||
|  |     needs: gcc | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         include: | ||||||
|  |           - board: uno | ||||||
|  |           - board: esp01 | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Set up Python 3.x | ||||||
|  |         uses: actions/setup-python@v2 | ||||||
|  |         with: | ||||||
|  |           python-version: '3.x'  | ||||||
|  |       - name: Install PlatformIO | ||||||
|  |         run: pip install platformio | ||||||
|  |       - name: Build | ||||||
|  |         run: extras/ci/platformio.sh ${{ matrix.board }} | ||||||
|  |  | ||||||
|  |   particle: | ||||||
|  |     name: Particle | ||||||
|  |     needs: gcc | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         include: | ||||||
|  |           - board: argon | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Install Particle CLI | ||||||
|  |         run: sudo npm install -g particle-cli | ||||||
|  |       - name: Login to Particle | ||||||
|  |         run: particle login -t "${{ secrets.PARTICLE_TOKEN }}" | ||||||
|  |       - name: Compile | ||||||
|  |         run: extras/ci/particle.sh ${{ matrix.board }} | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   arm: | ||||||
|  |     name: GCC for ARM processor | ||||||
|  |     needs: gcc | ||||||
|  |     runs-on: ubuntu-20.04 | ||||||
|  |     steps: | ||||||
|  |       - name: Install | ||||||
|  |         run: sudo apt-get install -y g++-arm-linux-gnueabihf | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Configure | ||||||
|  |         run: cmake . | ||||||
|  |         env: | ||||||
|  |           CC: arm-linux-gnueabihf-gcc | ||||||
|  |           CXX: arm-linux-gnueabihf-g++ | ||||||
|  |       - name: Build | ||||||
|  |         run: cmake --build . | ||||||
|  |  | ||||||
|  |   coverage: | ||||||
|  |     needs: gcc | ||||||
|  |     name: Coverage | ||||||
|  |     runs-on: ubuntu-20.04 | ||||||
|  |     steps: | ||||||
|  |       - name: Install | ||||||
|  |         run: sudo apt-get install -y lcov ninja-build | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Configure | ||||||
|  |         run: cmake -G Ninja -DCOVERAGE=true . | ||||||
|  |       - name: Build | ||||||
|  |         run: ninja | ||||||
|  |       - name: Test | ||||||
|  |         run: ninja test | ||||||
|  |       - name: lcov --capture | ||||||
|  |         run: lcov --capture --no-external --directory . --output-file coverage.info | ||||||
|  |       - name: lcov --remove | ||||||
|  |         run: lcov --remove coverage.info "$(pwd)/extras/*" --output-file coverage_filtered.info | ||||||
|  |       - name: genhtml | ||||||
|  |         run: mkdir coverage && genhtml coverage_filtered.info -o coverage -t ArduinoJson | ||||||
|  |       - name: Upload HTML report | ||||||
|  |         uses: actions/upload-artifact@v2 | ||||||
|  |         with: | ||||||
|  |           name: coverage | ||||||
|  |           path: coverage | ||||||
|  |       - name: Upload to Coveralls | ||||||
|  |         uses: coverallsapp/github-action@master | ||||||
|  |         with: | ||||||
|  |           github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  |           path-to-lcov: coverage_filtered.info | ||||||
							
								
								
									
										137
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										137
									
								
								.travis.yml
									
									
									
									
									
								
							| @@ -1,137 +0,0 @@ | |||||||
| sudo: false |  | ||||||
| language: cpp |  | ||||||
| matrix: |  | ||||||
|   include: |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-4.4'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-4.4 _CXX=g++-4.4 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-4.6'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-4.6 _CXX=g++-4.6 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-4.7'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-4.7 _CXX=g++-4.7 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-4.8'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-4.8 _CXX=g++-4.8  |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-4.9'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-4.9 _CXX=g++-4.9 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-5'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-5 _CXX=g++-5 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-6'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-6 _CXX=g++-6 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-7'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-7 _CXX=g++-7 CXXFLAGS="-fsanitize=leak" |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-8'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-8 _CXX=g++-8 CXXFLAGS="-fsanitize=undefined" LDFLAGS="-fuse-ld=gold" |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['g++-9'] |  | ||||||
|       env: SCRIPT=test _CC=gcc-9 _CXX=g++-9 CXXFLAGS="-fsanitize=address" |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           packages: ['g++-arm-linux-gnueabihf'] |  | ||||||
|       env: SCRIPT=build _CC=arm-linux-gnueabihf-gcc _CXX=arm-linux-gnueabihf-g++ |  | ||||||
|     - env: SCRIPT=test _CC=clang _CXX=clang++ |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5'] |  | ||||||
|           packages: ['clang-3.5'] |  | ||||||
|       env: SCRIPT=test _CC=clang-3.5 _CXX=clang++-3.5 CXXFLAGS="-fsanitize=address" |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.6'] |  | ||||||
|           packages: ['clang-3.6'] |  | ||||||
|       env: SCRIPT=test _CC=clang-3.6 _CXX=clang++-3.6 CXXFLAGS="-fsanitize=leak" |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.7'] |  | ||||||
|           packages: ['clang-3.7'] |  | ||||||
|       env: SCRIPT=test _CC=clang-3.7 _CXX=clang++-3.7 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.8'] |  | ||||||
|           packages: ['clang-3.8'] |  | ||||||
|       env: SCRIPT=test _CC=clang-3.8 _CXX=clang++-3.8 CXXFLAGS="-fsanitize=undefined" |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test','llvm-toolchain-trusty-3.9'] |  | ||||||
|           packages: ['clang-3.9'] |  | ||||||
|       env: SCRIPT=test _CC=clang-3.9 _CXX=clang++-3.9 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test','llvm-toolchain-trusty-4.0'] |  | ||||||
|           packages: ['clang-4.0'] |  | ||||||
|       env: SCRIPT=test _CC=clang-4.0 _CXX=clang++-4.0 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['clang-5.0'] |  | ||||||
|       env: SCRIPT=test _CC=clang-5.0 _CXX=clang++-5.0 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test'] |  | ||||||
|           packages: ['clang-6.0'] |  | ||||||
|       env: SCRIPT=test _CC=clang-6.0 _CXX=clang++-6.0 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test','llvm-toolchain-trusty-7'] |  | ||||||
|           packages: ['clang-7'] |  | ||||||
|       env: SCRIPT=test _CC=clang-7 _CXX=clang++-7 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: ['ubuntu-toolchain-r-test','llvm-toolchain-trusty-8'] |  | ||||||
|           packages: ['clang-8'] |  | ||||||
|       env: SCRIPT=test _CC=clang-8 _CXX=clang++-8 |  | ||||||
|     - addons: |  | ||||||
|         apt: |  | ||||||
|           sources: |  | ||||||
|             - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' |  | ||||||
|               key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' |  | ||||||
|           packages: ['clang-9'] |  | ||||||
|       env: SCRIPT=test _CC=clang-9 _CXX=clang++-9 |  | ||||||
|     - env: SCRIPT=coverage |  | ||||||
|     - os: osx |  | ||||||
|       osx_image: xcode8.3 |  | ||||||
|       env: SCRIPT=test |  | ||||||
|     - os: osx |  | ||||||
|       osx_image: xcode9.4 |  | ||||||
|       env: SCRIPT=test |  | ||||||
|     - os: osx |  | ||||||
|       osx_image: xcode10 |  | ||||||
|       env: SCRIPT=test CXXFLAGS="-fsanitize=address" |  | ||||||
|     - env: SCRIPT=arduino VERSION=1.6.7 BOARD=arduino:avr:uno |  | ||||||
|     - env: SCRIPT=arduino VERSION=1.8.2 BOARD=arduino:samd:mkr1000 |  | ||||||
|     - env: SCRIPT=platformio BOARD=uno |  | ||||||
|     - env: SCRIPT=platformio BOARD=esp01 |  | ||||||
|     - env: SCRIPT=particle BOARD=argon |  | ||||||
| cache: |  | ||||||
|   directories: |  | ||||||
|     - "~/.platformio" |  | ||||||
|     - "extras/fuzzing/json_corpus" |  | ||||||
|     - "extras/fuzzing/msgpack_corpus" |  | ||||||
| script: extras/ci/$SCRIPT.sh |  | ||||||
| @@ -6,6 +6,5 @@ You can submit changes via GitHub Pull Requests. | |||||||
|  |  | ||||||
| Please: | Please: | ||||||
|  |  | ||||||
| 1. Unit test every change in behavior | 1. Update the test suite for any change of behavior | ||||||
| 2. Use clang-format in "file" mode to format the code | 2. Use clang-format in "file" mode to format the code | ||||||
| 3. Consider using the Continuous Integration (Travis and AppVeyor) |  | ||||||
|   | |||||||
							
								
								
									
										14
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								README.md
									
									
									
									
									
								
							| @@ -3,8 +3,8 @@ | |||||||
| --- | --- | ||||||
|  |  | ||||||
| [](https://www.ardu-badge.com/ArduinoJson/6.17.2) | [](https://www.ardu-badge.com/ArduinoJson/6.17.2) | ||||||
| [](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) | [](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A6.x) | ||||||
| [](https://travis-ci.org/bblanchon/ArduinoJson) | [](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) | ||||||
| [](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) | [](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) | ||||||
| [](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) | [](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) | ||||||
| [](https://github.com/bblanchon/ArduinoJson/stargazers) | [](https://github.com/bblanchon/ArduinoJson/stargazers) | ||||||
| @@ -19,7 +19,7 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). | |||||||
|     * [Optionally supports comments in the input](https://arduinojson.org/v6/api/config/enable_comments/?utm_source=github&utm_medium=readme) |     * [Optionally supports comments in the input](https://arduinojson.org/v6/api/config/enable_comments/?utm_source=github&utm_medium=readme) | ||||||
|     * [Optionally filters the input to keep only desired values](https://arduinojson.org/v6/api/json/deserializejson/?utm_source=github&utm_medium=readme#filtering) |     * [Optionally filters the input to keep only desired values](https://arduinojson.org/v6/api/json/deserializejson/?utm_source=github&utm_medium=readme#filtering) | ||||||
|     * Supports single quotes as a string delimiter |     * Supports single quotes as a string delimiter | ||||||
|     * Compatible with NDJSON and JSON Lines |     * Compatible with [NDJSON](http://ndjson.org/) and [JSON Lines](https://jsonlines.org/) | ||||||
| * [JSON serialization](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme) | * [JSON serialization](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme) | ||||||
|     * [Can write to a buffer or a stream](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme) |     * [Can write to a buffer or a stream](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme) | ||||||
|     * [Optionally indents the document (prettified JSON)](https://arduinojson.org/v6/api/json/serializejsonpretty/?utm_source=github&utm_medium=readme) |     * [Optionally indents the document (prettified JSON)](https://arduinojson.org/v6/api/json/serializejsonpretty/?utm_source=github&utm_medium=readme) | ||||||
| @@ -58,11 +58,12 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). | |||||||
|         * [IAR Embedded Workbench](https://www.iar.com/iar-embedded-workbench/) |         * [IAR Embedded Workbench](https://www.iar.com/iar-embedded-workbench/) | ||||||
|         * [Keil uVision](http://www.keil.com/) |         * [Keil uVision](http://www.keil.com/) | ||||||
|         * [MPLAB X IDE](http://www.microchip.com/mplab/mplab-x-ide) |         * [MPLAB X IDE](http://www.microchip.com/mplab/mplab-x-ide) | ||||||
|  |         * [Particle](https://www.particle.io/) | ||||||
|         * [PlatformIO](http://platformio.org/) |         * [PlatformIO](http://platformio.org/) | ||||||
|         * [Sloeber plugin for Eclipse](https://eclipse.baeyens.it/) |         * [Sloeber plugin for Eclipse](https://eclipse.baeyens.it/) | ||||||
|         * [Visual Micro](http://www.visualmicro.com/) |         * [Visual Micro](http://www.visualmicro.com/) | ||||||
|         * [Visual Studio](https://www.visualstudio.com/) |         * [Visual Studio](https://www.visualstudio.com/) | ||||||
|     * [Even works with online compilers like wandbox.org](https://wandbox.org/permlink/t7KP7I6dVuLhqzDl) |     * [Even works with online compilers like wandbox.org](https://wandbox.org/permlink/RlZSKy17DjJ6HcdN) | ||||||
|     * [CMake friendly](https://arduinojson.org/v6/how-to/use-arduinojson-with-cmake/?utm_source=github&utm_medium=readme) |     * [CMake friendly](https://arduinojson.org/v6/how-to/use-arduinojson-with-cmake/?utm_source=github&utm_medium=readme) | ||||||
| * Well designed | * Well designed | ||||||
|     * [Elegant API](http://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme) |     * [Elegant API](http://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme) | ||||||
| @@ -76,8 +77,8 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). | |||||||
|     * [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) |     * [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) | ||||||
|     * Continuously tested on |     * Continuously tested on | ||||||
|         * [Visual Studio 2010, 2012, 2013, 2015, 2017, 2019](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) |         * [Visual Studio 2010, 2012, 2013, 2015, 2017, 2019](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) | ||||||
|         * [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8](https://travis-ci.org/bblanchon/ArduinoJson) |         * [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) | ||||||
|         * [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8](https://travis-ci.org/bblanchon/ArduinoJson) |         * [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) | ||||||
|     * [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) |     * [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) | ||||||
| * Well documented | * Well documented | ||||||
|     * [Tutorials](https://arduinojson.org/v6/doc/deserialization/?utm_source=github&utm_medium=readme) |     * [Tutorials](https://arduinojson.org/v6/doc/deserialization/?utm_source=github&utm_medium=readme) | ||||||
| @@ -85,6 +86,7 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). | |||||||
|     * [How-tos](https://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme) |     * [How-tos](https://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme) | ||||||
|     * [FAQ](https://arduinojson.org/v6/faq/?utm_source=github&utm_medium=readme) |     * [FAQ](https://arduinojson.org/v6/faq/?utm_source=github&utm_medium=readme) | ||||||
|     * [Book](https://arduinojson.org/book/?utm_source=github&utm_medium=readme) |     * [Book](https://arduinojson.org/book/?utm_source=github&utm_medium=readme) | ||||||
|  |     * [Changelog](changelog.md) | ||||||
| * Vibrant user community | * Vibrant user community | ||||||
|     * Most popular of all Arduino libraries on [GitHub](https://github.com/search?o=desc&q=arduino+library&s=stars&type=Repositories) and [PlatformIO](https://platformio.org/lib/search) |     * Most popular of all Arduino libraries on [GitHub](https://github.com/search?o=desc&q=arduino+library&s=stars&type=Repositories) and [PlatformIO](https://platformio.org/lib/search) | ||||||
|     * [Used in hundreds of projects](https://www.hackster.io/search?i=projects&q=arduinojson) |     * [Used in hundreds of projects](https://www.hackster.io/search?i=projects&q=arduinojson) | ||||||
|   | |||||||
| @@ -1,7 +0,0 @@ | |||||||
| #!/bin/sh -ex |  | ||||||
|  |  | ||||||
| export CC="$_CC" |  | ||||||
| export CXX="$_CXX" |  | ||||||
|  |  | ||||||
| cmake -DCMAKE_BUILD_TYPE=Release . |  | ||||||
| cmake --build . |  | ||||||
| @@ -1,9 +0,0 @@ | |||||||
| #!/bin/sh -eux |  | ||||||
|  |  | ||||||
| cmake -DCOVERAGE=true . |  | ||||||
| make  |  | ||||||
| make test |  | ||||||
|  |  | ||||||
| pip install --user cpp-coveralls 'requests[security]' |  | ||||||
| pwd |  | ||||||
| coveralls --include 'src' --gcov-options '\-lp' |  | ||||||
| @@ -1,22 +0,0 @@ | |||||||
| #!/bin/bash -eux |  | ||||||
|  |  | ||||||
| ROOT_DIR=$(dirname $0)/../../ |  | ||||||
| FUZZING_DIR=${ROOT_DIR}/extras/fuzzing/ |  | ||||||
|  |  | ||||||
| export CC="clang-${CLANG}" |  | ||||||
| export CXX="clang++-${CLANG}" |  | ||||||
| cmake -DCMAKE_BUILD_TYPE=Debug . |  | ||||||
|  |  | ||||||
| FUZZER_TARGET="${FUZZER}_fuzzer" |  | ||||||
| FUZZER_PATH="extras/fuzzing/${FUZZER_TARGET}" |  | ||||||
| CORPUS_DIR="${FUZZING_DIR}/${FUZZER}_corpus" |  | ||||||
| SEED_CORPUS_DIR="${FUZZING_DIR}/${FUZZER}_seed_corpus" |  | ||||||
|  |  | ||||||
| cmake --build . --target $FUZZER_TARGET |  | ||||||
|  |  | ||||||
| export ASAN_OPTIONS="detect_leaks=0" |  | ||||||
| export LLVM_PROFILE_FILE="${FUZZER_TARGET}.profraw" |  | ||||||
| ${FUZZER_PATH} "$CORPUS_DIR" "$SEED_CORPUS_DIR" -max_total_time=60 -timeout=1 |  | ||||||
|  |  | ||||||
| llvm-profdata-${CLANG} merge -sparse ${LLVM_PROFILE_FILE} -o ${FUZZER_TARGET}.profdata |  | ||||||
| llvm-cov-${CLANG} report ./${FUZZER_PATH} -instr-profile=${FUZZER_TARGET}.profdata |  | ||||||
| @@ -1,11 +1,9 @@ | |||||||
| #!/bin/sh -ex | #!/bin/sh -ex | ||||||
|  |  | ||||||
|  | BOARD=$1 | ||||||
|  |  | ||||||
| cd "$(dirname "$0")/../../" | cd "$(dirname "$0")/../../" | ||||||
|  |  | ||||||
| npm install -g particle-cli |  | ||||||
|  |  | ||||||
| particle login -t "${PARTICLE_TOKEN}" |  | ||||||
|  |  | ||||||
| cp extras/particle/src/smocktest.ino src/ | cp extras/particle/src/smocktest.ino src/ | ||||||
| cp extras/particle/project.properties ./ | cp extras/particle/project.properties ./ | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| #!/bin/sh -eux | #!/bin/sh -eux | ||||||
|  |  | ||||||
| pip install --user platformio | BOARD=$1 | ||||||
|  |  | ||||||
| case $BOARD in | case $BOARD in | ||||||
| uno) | uno) | ||||||
|   | |||||||
| @@ -1,8 +0,0 @@ | |||||||
| #!/bin/sh -ex |  | ||||||
|  |  | ||||||
| export CC="$_CC" |  | ||||||
| export CXX="$_CXX" |  | ||||||
|  |  | ||||||
| cmake -DCMAKE_BUILD_TYPE=Debug . |  | ||||||
| cmake --build . |  | ||||||
| ctest --output-on-failure . |  | ||||||
| @@ -22,11 +22,8 @@ target_link_libraries(json_reproducer | |||||||
| 	ArduinoJson | 	ArduinoJson | ||||||
| ) | ) | ||||||
|  |  | ||||||
| # Infer path of llvm-symbolizer from the path of clang | macro(add_fuzzer name)	 | ||||||
| string(REPLACE "clang++" "llvm-symbolizer" LLVM_SYMBOLIZER ${CMAKE_CXX_COMPILER}) | 	set(FUZZER "${name}_fuzzer") | ||||||
|  |  | ||||||
| macro(add_fuzzer name mode)	 |  | ||||||
| 	set(FUZZER "${name}_${mode}_fuzzer") |  | ||||||
| 	set(CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_corpus") | 	set(CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_corpus") | ||||||
| 	set(SEED_CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_seed_corpus") | 	set(SEED_CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_seed_corpus") | ||||||
| 	add_executable("${FUZZER}" | 	add_executable("${FUZZER}" | ||||||
| @@ -38,9 +35,9 @@ macro(add_fuzzer name mode) | |||||||
| 	set_target_properties("${FUZZER}" | 	set_target_properties("${FUZZER}" | ||||||
| 		PROPERTIES  | 		PROPERTIES  | ||||||
| 			COMPILE_FLAGS   | 			COMPILE_FLAGS   | ||||||
| 				"-fprofile-instr-generate -fcoverage-mapping -fsanitize=${mode},fuzzer -fno-sanitize-recover=all" | 				"-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all" | ||||||
| 			LINK_FLAGS | 			LINK_FLAGS | ||||||
| 				"-fprofile-instr-generate -fcoverage-mapping -fsanitize=${mode},fuzzer -fno-sanitize-recover=all" | 				"-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all" | ||||||
| 	) | 	) | ||||||
|  |  | ||||||
| 	add_test( | 	add_test( | ||||||
| @@ -49,29 +46,9 @@ macro(add_fuzzer name mode) | |||||||
| 		COMMAND | 		COMMAND | ||||||
| 			"${FUZZER}" "${CORPUS_DIR}" "${SEED_CORPUS_DIR}" -max_total_time=5 -timeout=1 | 			"${FUZZER}" "${CORPUS_DIR}" "${SEED_CORPUS_DIR}" -max_total_time=5 -timeout=1 | ||||||
| 	) | 	) | ||||||
|  |  | ||||||
| 	set_tests_properties("${FUZZER}" |  | ||||||
| 		PROPERTIES |  | ||||||
| 			ENVIRONMENT |  | ||||||
| 				ASAN_SYMBOLIZER_PATH=${LLVM_SYMBOLIZER} |  | ||||||
| 			ENVIRONMENT |  | ||||||
| 				LLVM_SYMBOLIZER_PATH=${LLVM_SYMBOLIZER} |  | ||||||
| 			ENVIRONMENT |  | ||||||
| 				MSAN_SYMBOLIZER_PATH=${LLVM_SYMBOLIZER} |  | ||||||
| 			ENVIRONMENT |  | ||||||
| 				UBSAN_SYMBOLIZER_PATH=${LLVM_SYMBOLIZER} |  | ||||||
| 	) |  | ||||||
| endmacro() | endmacro() | ||||||
|  |  | ||||||
| if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6) | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6) | ||||||
| 	add_fuzzer(json address) | 	add_fuzzer(json) | ||||||
| 	add_fuzzer(json undefined) | 	add_fuzzer(msgpack) | ||||||
| 	add_fuzzer(msgpack address) |  | ||||||
| 	add_fuzzer(msgpack undefined) |  | ||||||
| endif() |  | ||||||
|  |  | ||||||
| if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7) |  | ||||||
| 	# We're getting false positive with Clang 6 |  | ||||||
| 	add_fuzzer(json memory) |  | ||||||
| 	add_fuzzer(msgpack memory) |  | ||||||
| endif() | endif() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user