Compile and run tests in parallel (-j)

This commit is contained in:
John Keiser 2020-04-19 10:02:47 -07:00
parent e5e6a46c37
commit b6e23b2d3e
2 changed files with 34 additions and 26 deletions

View File

@ -7,24 +7,32 @@ executors:
- image: gcc:7 - image: gcc:7
environment: environment:
CXX: g++ CXX: g++
BUILD_FLAGS: -j
CTEST_FLAGS: -j --output-on-failure
gcc8: gcc8:
docker: docker:
- image: gcc:8 - image: gcc:8
environment: environment:
CXX: g++ CXX: g++
BUILD_FLAGS: -j
CTEST_FLAGS: -j --output-on-failure
gcc9: gcc9:
docker: docker:
- image: gcc:9 - image: gcc:9
environment: environment:
CXX: g++ CXX: g++
BUILD_FLAGS: -j
CTEST_FLAGS: -j --output-on-failure
clang6: clang6:
docker: docker:
- image: ubuntu:18.04 - image: ubuntu:18.04
environment: environment:
CXX: clang++-6.0 CXX: clang++-6.0
BUILD_FLAGS: -j
CTEST_FLAGS: -j --output-on-failure
# Reusable test commands (and initializer for clang 6) # Reusable test commands (and initializer for clang 6)
commands: commands:
@ -36,7 +44,7 @@ commands:
make_test: make_test:
steps: steps:
- checkout - checkout
- run: make - run: make $BUILD_FLAGS
- run: ./json2json -h # Print out the implementation we're using on this hardware - run: ./json2json -h # Print out the implementation we're using on this hardware
- run: make amalgamate - run: make amalgamate
- run: make test - run: make test
@ -51,24 +59,24 @@ commands:
cmake_build: cmake_build:
steps: steps:
- cmake_prep - cmake_prep
- run: cmake $CMAKE_FLAGS $CMAKE_IMPLEMENTATION_FLAGS -DCMAKE_INSTALL_PREFIX:PATH=destination . - run: cmake $CMAKE_FLAGS -DCMAKE_INSTALL_PREFIX:PATH=destination .
- run: make all - run: make $BUILD_FLAGS all
- run: tools/json2json -h # Print out the implementation we're using on this hardware - run: tools/json2json -h # Print out the implementation we're using on this hardware
cmake_test: cmake_test:
steps: steps:
- cmake_build - cmake_build
- run: ctest --output-on-failure -L acceptance - run: ctest $CTEST_FLAGS -L acceptance
- run: ctest --output-on-failure -LE acceptance - run: ctest $CTEST_FLAGS -LE acceptance
cmake_test_all: cmake_test_all:
steps: steps:
- cmake_build - cmake_build
- run: ctest --output-on-failure -L acceptance -LE per_implementation - run: ctest $CTEST_FLAGS -L acceptance -LE per_implementation
- run: SIMDJSON_FORCE_IMPLEMENTATION=haswell ctest --output-on-failure -L per_implementation - run: SIMDJSON_FORCE_IMPLEMENTATION=haswell ctest $CTEST_FLAGS -L per_implementation
- run: SIMDJSON_FORCE_IMPLEMENTATION=westmere ctest --output-on-failure -L per_implementation - run: SIMDJSON_FORCE_IMPLEMENTATION=westmere ctest $CTEST_FLAGS -L per_implementation
- run: SIMDJSON_FORCE_IMPLEMENTATION=fallback ctest --output-on-failure -L per_implementation - run: SIMDJSON_FORCE_IMPLEMENTATION=fallback ctest $CTEST_FLAGS -L per_implementation
- run: ctest --output-on-failure -LE "acceptance|per_implementation" # Everything we haven't run yet, run now. - run: ctest $CTEST_FLAGS -LE "acceptance|per_implementation" # Everything we haven't run yet, run now.
# we not only want cmake to build and run tests, but we want also a successful installation from which we can build, link and run programs # we not only want cmake to build and run tests, but we want also a successful installation from which we can build, link and run programs
cmake_install_test: # this version builds, install, test and then verify from the installation cmake_install_test: # this version builds, install, test and then verify from the installation
@ -94,7 +102,7 @@ jobs:
sanitize-gcc7: sanitize-gcc7:
description: Build and run tests on GCC 7 and AVX 2 with a cmake sanitize build description: Build and run tests on GCC 7 and AVX 2 with a cmake sanitize build
executor: gcc7 executor: gcc7
environment: { CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON } environment: { CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON, BUILD_FLAGS: "" } # gcc sanitize seems to have bugs with -j :(
steps: [ cmake_test_all ] steps: [ cmake_test_all ]
sanitize-clang6: sanitize-clang6:
description: Build and run tests on clang 6 and AVX 2 with a cmake sanitize build description: Build and run tests on clang 6 and AVX 2 with a cmake sanitize build

View File

@ -231,7 +231,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ctest --output-on-failure - ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: amd64_clang_cmake_no_exceptions name: amd64_clang_cmake_no_exceptions
@ -254,7 +254,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ctest --output-on-failure - ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: amd64_clang_cmake_static name: amd64_clang_cmake_static
@ -277,7 +277,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ctest --output-on-failure - ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: amd64_gcc_cmake_static name: amd64_gcc_cmake_static
@ -300,7 +300,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ctest --output-on-failure - ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: amd64_gcc_cmake_dynamic name: amd64_gcc_cmake_dynamic
@ -323,7 +323,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ctest --output-on-failure - ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: arm64_clang_cmake_dynamic name: arm64_clang_cmake_dynamic
@ -346,7 +346,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ctest --output-on-failure - ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: arm64_gcc_cmake_dynamic name: arm64_gcc_cmake_dynamic
@ -369,7 +369,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ctest --output-on-failure - ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: arm64_clang_cmake_static name: arm64_clang_cmake_static
@ -392,7 +392,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ctest --output-on-failure - ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: arm64_gcc_cmake_static name: arm64_gcc_cmake_static
@ -415,7 +415,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ctest --output-on-failure - ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
@ -439,7 +439,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure - ASAN_OPTIONS="detect_leaks=0" ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: arm64_gcc_cmake_sanitize name: arm64_gcc_cmake_sanitize
@ -462,7 +462,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure - ASAN_OPTIONS="detect_leaks=0" ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
@ -486,7 +486,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure - ASAN_OPTIONS="detect_leaks=0" ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: amd64_gcc_cmake_sanitize name: amd64_gcc_cmake_sanitize
@ -509,7 +509,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure - ASAN_OPTIONS="detect_leaks=0" ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
@ -533,7 +533,7 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure - ASAN_OPTIONS="detect_leaks=0" ctest -j --output-on-failure
--- ---
kind: pipeline kind: pipeline
name: amd64_gcc_cmake_sanitize_noavx name: amd64_gcc_cmake_sanitize_noavx
@ -556,4 +556,4 @@ steps:
- mkdir build && cd build - mkdir build && cd build
- cmake $CMAKE_FLAGS .. - cmake $CMAKE_FLAGS ..
- make -j - make -j
- ASAN_OPTIONS="detect_leaks=0" ctest --output-on-failure - ASAN_OPTIONS="detect_leaks=0" ctest -j --output-on-failure