Adding more sanitize tests as part of the CI. (#267)
* Adding more sanitize tests as part of the CI.
This commit is contained in:
parent
9dfab9d9a4
commit
7be2998cae
|
@ -19,4 +19,4 @@ build_script:
|
||||||
- cd build
|
- cd build
|
||||||
- ps: cmake -DSIMDJSON_BUILD_STATIC="$env:SIMDJSON_BUILD_STATIC" -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR_PLATFORM=x64 ..
|
- ps: cmake -DSIMDJSON_BUILD_STATIC="$env:SIMDJSON_BUILD_STATIC" -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR_PLATFORM=x64 ..
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
- ctest --verbose
|
- ctest --verbose --output-on-failure
|
||||||
|
|
|
@ -25,19 +25,46 @@ jobs:
|
||||||
command: make quiettest amalgamate
|
command: make quiettest amalgamate
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building (gcc, cmake)
|
name: Building (gcc, cmake, dynamic)
|
||||||
command: |
|
command: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake -DSIMDJSON_BUILD_STATIC=OFF ..
|
||||||
make
|
make
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Running tests (gcc, cmake)
|
name: Running tests (gcc, cmake, dynamic)
|
||||||
command: |
|
command: |
|
||||||
cd build
|
cd build
|
||||||
make test
|
make test
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Building (gcc, cmake, static)
|
||||||
|
command: |
|
||||||
|
mkdir buildstatic
|
||||||
|
cd buildstatic
|
||||||
|
cmake -DSIMDJSON_BUILD_STATIC=ON ..
|
||||||
|
make
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Running tests (gcc, cmake, static)
|
||||||
|
command: |
|
||||||
|
cd buildstatic
|
||||||
|
make test
|
||||||
|
- run:
|
||||||
|
name: Building (gcc, cmake, sanitize)
|
||||||
|
command: |
|
||||||
|
mkdir buildsani
|
||||||
|
cd buildsani
|
||||||
|
cmake -DSIMDJSON_SANITIZE=ON -DSIMDJSON_BUILD_STATIC=OFF ..
|
||||||
|
make
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Running tests (gcc, cmake, sanitize)
|
||||||
|
command: |
|
||||||
|
cd buildsani
|
||||||
|
make test
|
||||||
|
|
||||||
"gccnoavx":
|
"gccnoavx":
|
||||||
docker:
|
docker:
|
||||||
- image: ubuntu:18.04
|
- image: ubuntu:18.04
|
||||||
|
@ -63,19 +90,46 @@ jobs:
|
||||||
command: ARCHFLAGS="-march=nehalem" make quiettest amalgamate
|
command: ARCHFLAGS="-march=nehalem" make quiettest amalgamate
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building (gcc, cmake)
|
name: Building (gcc, cmake, dynamic)
|
||||||
command: |
|
command: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DSIMDJSON_DISABLE_AVX=on ..
|
cmake -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=OFF ..
|
||||||
make
|
make
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Running tests (gcc, cmake)
|
name: Running tests (gcc, cmake, dynamic)
|
||||||
command: |
|
command: |
|
||||||
cd build
|
cd build
|
||||||
make test
|
make test
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Building (gcc, cmake, static)
|
||||||
|
command: |
|
||||||
|
mkdir buildstatic
|
||||||
|
cd buildstatic
|
||||||
|
cmake -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=ON ..
|
||||||
|
make
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Running tests (gcc, cmake, static)
|
||||||
|
command: |
|
||||||
|
cd buildstatic
|
||||||
|
make test
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Building (gcc, cmake, sanitize)
|
||||||
|
command: |
|
||||||
|
mkdir buildsani
|
||||||
|
cd buildsani
|
||||||
|
cmake -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_SANITIZE=ON ..
|
||||||
|
make
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Running tests (gcc, cmake, sanitize)
|
||||||
|
command: |
|
||||||
|
cd buildsani
|
||||||
|
make test
|
||||||
"clang":
|
"clang":
|
||||||
docker:
|
docker:
|
||||||
- image: ubuntu:18.04
|
- image: ubuntu:18.04
|
||||||
|
@ -101,19 +155,47 @@ jobs:
|
||||||
command: make quiettest amalgamate
|
command: make quiettest amalgamate
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building (clang, cmake)
|
name: Building (clang, cmake, dynamic)
|
||||||
command: |
|
command: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake -DSIMDJSON_BUILD_STATIC=OFF ..
|
||||||
make
|
make
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Running tests (clang, cmake)
|
name: Running tests (clang, cmake, dynamic)
|
||||||
command: |
|
command: |
|
||||||
cd build
|
cd build
|
||||||
make test
|
make test
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Building (clang, cmake, static)
|
||||||
|
command: |
|
||||||
|
mkdir buildstatic
|
||||||
|
cd buildstatic
|
||||||
|
cmake -DSIMDJSON_BUILD_STATIC=ON ..
|
||||||
|
make
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Running tests (clang, cmake, static)
|
||||||
|
command: |
|
||||||
|
cd buildstatic
|
||||||
|
make test
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Building (clang, cmake, sanitize)
|
||||||
|
command: |
|
||||||
|
mkdir buildsani
|
||||||
|
cd buildsani
|
||||||
|
cmake -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON ..
|
||||||
|
make
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Running tests (clang, cmake, sanitize)
|
||||||
|
command: |
|
||||||
|
cd buildsani
|
||||||
|
make test
|
||||||
|
|
||||||
"clangnoavx":
|
"clangnoavx":
|
||||||
docker:
|
docker:
|
||||||
- image: ubuntu:18.04
|
- image: ubuntu:18.04
|
||||||
|
@ -139,19 +221,49 @@ jobs:
|
||||||
command: ARCHFLAGS="-march=nehalem" make quiettest amalgamate
|
command: ARCHFLAGS="-march=nehalem" make quiettest amalgamate
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building (clang, cmake)
|
name: Building (clang, cmake, dynamic)
|
||||||
command: |
|
command: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DSIMDJSON_DISABLE_AVX=on ..
|
cmake -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_DISABLE_AVX=on ..
|
||||||
make
|
make
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Running tests (clang, cmake)
|
name: Running tests (clang, cmake, dynamic)
|
||||||
command: |
|
command: |
|
||||||
cd build
|
cd build
|
||||||
make test
|
make test
|
||||||
|
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Building (clang, cmake, static)
|
||||||
|
command: |
|
||||||
|
mkdir buildstatic
|
||||||
|
cd buildstatic
|
||||||
|
cmake -DSIMDJSON_BUILD_STATIC=ON -DSIMDJSON_DISABLE_AVX=on ..
|
||||||
|
make
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Running tests (clang, cmake, static)
|
||||||
|
command: |
|
||||||
|
cd buildstatic
|
||||||
|
make test
|
||||||
|
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Building (clang, cmake, sanitize)
|
||||||
|
command: |
|
||||||
|
mkdir buildsani
|
||||||
|
cd buildsani
|
||||||
|
cmake -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_SANITIZE=ON ..
|
||||||
|
make
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Running tests (clang, cmake, sanitize)
|
||||||
|
command: |
|
||||||
|
cd buildsani
|
||||||
|
make test
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
build_and_test:
|
build_and_test:
|
||||||
|
@ -159,4 +271,4 @@ workflows:
|
||||||
- "clang"
|
- "clang"
|
||||||
- "gcc"
|
- "gcc"
|
||||||
- "clangnoavx"
|
- "clangnoavx"
|
||||||
- "gccnoavx"
|
- "gccnoavx"
|
||||||
|
|
148
.drone.yml
148
.drone.yml
|
@ -63,7 +63,7 @@ steps:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake -DSIMDJSON_BUILD_STATIC=OFF $CMAKE_FLAGS ..
|
- cmake -DSIMDJSON_BUILD_STATIC=OFF $CMAKE_FLAGS ..
|
||||||
- make -j
|
- make -j
|
||||||
- ctest
|
- ctest --output-on-failure
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: amd64_clang_cmake_static
|
name: amd64_clang_cmake_static
|
||||||
|
@ -85,7 +85,7 @@ steps:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake -DSIMDJSON_BUILD_STATIC=ON $CMAKE_FLAGS ..
|
- cmake -DSIMDJSON_BUILD_STATIC=ON $CMAKE_FLAGS ..
|
||||||
- make -j
|
- make -j
|
||||||
- ctest
|
- ctest --output-on-failure
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: amd64_gcc_cmake_static
|
name: amd64_gcc_cmake_static
|
||||||
|
@ -107,7 +107,7 @@ steps:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake -DSIMDJSON_BUILD_STATIC=ON $CMAKE_FLAGS ..
|
- cmake -DSIMDJSON_BUILD_STATIC=ON $CMAKE_FLAGS ..
|
||||||
- make -j
|
- make -j
|
||||||
- ctest
|
- ctest --output-on-failure
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: amd64_gcc_cmake_dynamic
|
name: amd64_gcc_cmake_dynamic
|
||||||
|
@ -129,7 +129,7 @@ steps:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake -DSIMDJSON_BUILD_STATIC=OFF $CMAKE_FLAGS ..
|
- cmake -DSIMDJSON_BUILD_STATIC=OFF $CMAKE_FLAGS ..
|
||||||
- make -j
|
- make -j
|
||||||
- ctest
|
- ctest --output-on-failure
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: arm64_clang_cmake_dynamic
|
name: arm64_clang_cmake_dynamic
|
||||||
|
@ -151,7 +151,7 @@ steps:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake -DSIMDJSON_BUILD_STATIC=OFF $CMAKE_FLAGS ..
|
- cmake -DSIMDJSON_BUILD_STATIC=OFF $CMAKE_FLAGS ..
|
||||||
- make -j
|
- make -j
|
||||||
- ctest
|
- ctest --output-on-failure
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: arm64_gcc_cmake_dynamic
|
name: arm64_gcc_cmake_dynamic
|
||||||
|
@ -173,7 +173,7 @@ steps:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake $CMAKE_FLAGS ..
|
- cmake $CMAKE_FLAGS ..
|
||||||
- make -j
|
- make -j
|
||||||
- ctest
|
- ctest --output-on-failure
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
- apt-get update -y
|
- apt-get update -y
|
||||||
|
@ -182,7 +182,7 @@ steps:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake -DSIMDJSON_BUILD_STATIC=OFF $CMAKE_FLAGS ..
|
- cmake -DSIMDJSON_BUILD_STATIC=OFF $CMAKE_FLAGS ..
|
||||||
- make -j
|
- make -j
|
||||||
- ctest
|
- ctest --output-on-failure
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: arm64_clang_cmake_static
|
name: arm64_clang_cmake_static
|
||||||
|
@ -204,7 +204,7 @@ steps:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake -DSIMDJSON_BUILD_STATIC=ON $CMAKE_FLAGS ..
|
- cmake -DSIMDJSON_BUILD_STATIC=ON $CMAKE_FLAGS ..
|
||||||
- make -j
|
- make -j
|
||||||
- ctest
|
- ctest --output-on-failure
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: arm64_gcc_cmake_static
|
name: arm64_gcc_cmake_static
|
||||||
|
@ -226,9 +226,139 @@ steps:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake -DSIMDJSON_BUILD_STATIC=ON $CMAKE_FLAGS ..
|
- cmake -DSIMDJSON_BUILD_STATIC=ON $CMAKE_FLAGS ..
|
||||||
- make -j
|
- make -j
|
||||||
- ctest
|
- ctest --output-on-failure
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: arm64_clang_cmake_sanitize
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: arm64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Build and Test
|
||||||
|
image: ubuntu:18.04
|
||||||
|
environment:
|
||||||
|
CC: clang
|
||||||
|
CXX: clang++
|
||||||
|
commands:
|
||||||
|
- apt-get update -y
|
||||||
|
- apt-get install -y make $CC g++ cmake
|
||||||
|
- $CC --version
|
||||||
|
- mkdir build && cd build
|
||||||
|
- cmake -DSIMDJSON_SANITIZE=ON $CMAKE_FLAGS ..
|
||||||
|
- make -j
|
||||||
|
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: arm64_gcc_cmake_sanitize
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: arm64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Build and Test
|
||||||
|
image: ubuntu:18.04
|
||||||
|
environment:
|
||||||
|
CC: gcc
|
||||||
|
CXX: g++
|
||||||
|
commands:
|
||||||
|
- apt-get update -y
|
||||||
|
- apt-get install -y make $CC g++ cmake
|
||||||
|
- $CC --version
|
||||||
|
- mkdir build && cd build
|
||||||
|
- cmake -DSIMDJSON_SANITIZE=ON $CMAKE_FLAGS ..
|
||||||
|
- make -j
|
||||||
|
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: amd64_clang_cmake_sanitize
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Build and Test
|
||||||
|
image: ubuntu:18.04
|
||||||
|
environment:
|
||||||
|
CC: clang
|
||||||
|
CXX: clang++
|
||||||
|
commands:
|
||||||
|
- apt-get update -y
|
||||||
|
- apt-get install -y make $CC g++ cmake
|
||||||
|
- $CC --version
|
||||||
|
- mkdir build && cd build
|
||||||
|
- cmake -DSIMDJSON_SANITIZE=ON $CMAKE_FLAGS ..
|
||||||
|
- make -j
|
||||||
|
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: amd64_gcc_cmake_sanitize
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Build and Test
|
||||||
|
image: ubuntu:18.04
|
||||||
|
environment:
|
||||||
|
CC: gcc
|
||||||
|
CXX: g++
|
||||||
|
commands:
|
||||||
|
- apt-get update -y
|
||||||
|
- apt-get install -y make $CC g++ cmake
|
||||||
|
- $CC --version
|
||||||
|
- mkdir build && cd build
|
||||||
|
- cmake -DSIMDJSON_SANITIZE=ON $CMAKE_FLAGS ..
|
||||||
|
- make -j
|
||||||
|
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: amd64_clang_cmake_sanitize_noavx
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Build and Test
|
||||||
|
image: ubuntu:18.04
|
||||||
|
environment:
|
||||||
|
CC: clang
|
||||||
|
CXX: clang++
|
||||||
|
commands:
|
||||||
|
- apt-get update -y
|
||||||
|
- apt-get install -y make $CC g++ cmake
|
||||||
|
- $CC --version
|
||||||
|
- mkdir build && cd build
|
||||||
|
- cmake -DSIMDJSON_SANITIZE=ON -DSIMDJSON_DISABLE_AVX=ON $CMAKE_FLAGS ..
|
||||||
|
- make -j
|
||||||
|
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: amd64_gcc_cmake_sanitize_noavx
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Build and Test
|
||||||
|
image: ubuntu:18.04
|
||||||
|
environment:
|
||||||
|
CC: gcc
|
||||||
|
CXX: g++
|
||||||
|
commands:
|
||||||
|
- apt-get update -y
|
||||||
|
- apt-get install -y make $CC g++ cmake
|
||||||
|
- $CC --version
|
||||||
|
- mkdir build && cd build
|
||||||
|
- cmake -DSIMDJSON_SANITIZE=ON -DSIMDJSON_DISABLE_AVX=ON $CMAKE_FLAGS ..
|
||||||
|
- make -j
|
||||||
|
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure
|
||||||
|
|
|
@ -12,19 +12,26 @@ if(SIMDJSON_SANITIZE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64)|(AMD64)|(x86_64)")
|
||||||
|
set (X64 TRUE)
|
||||||
|
else ()
|
||||||
|
set (X64 FALSE)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if(SIMDJSON_DISABLE_AVX)
|
if(X64)
|
||||||
if(NOT MSVC)
|
message(STATUS "Detected x64 processor: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
set (OPT_FLAGS "${OPT_FLAGS} -mno-avx -mno-bmi -mno-pclmul -msse4.2")
|
if(SIMDJSON_DISABLE_AVX)
|
||||||
else()
|
message(STATUS "Disabling AVX. No runtime dispatch.")
|
||||||
set (OPT_FLAGS "${OPT_FLAGS}")
|
if(NOT MSVC)
|
||||||
endif()
|
set (OPT_FLAGS "${OPT_FLAGS} -mno-avx -mno-bmi -mpclmul -msse4.2") #westmere
|
||||||
else()
|
else()
|
||||||
# some compilers like clang do not automagically define __AVX2__ and __BMI2__ even when the hardware supports it
|
set (OPT_FLAGS "${OPT_FLAGS}")
|
||||||
if(NOT MSVC)
|
endif()
|
||||||
#set (OPT_FLAGS "${OPT_FLAGS} -mpclmul")
|
else()
|
||||||
else()
|
if(NOT MSVC)
|
||||||
#set (OPT_FLAGS "${OPT_FLAGS} /arch:AVX2")
|
message(STATUS "Assuming Westmere or better")
|
||||||
|
set (OPT_FLAGS "${OPT_FLAGS} -mpclmul -msse4.2")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue