Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doctest to 2.4.6 + local fixes slated for upstream #716

Merged
merged 3 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test cereal
on: [push, pull_request]

jobs:
test_cereal_macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- CMAKE_OPTIONS: '-DWITH_WERROR=OFF -DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'clang++'
XCODE_VERSION: 11
NAME: macos-latest-clang-xcode11

- CMAKE_OPTIONS: '-DWITH_WERROR=OFF -DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'clang++'
XCODE_VERSION: 12
NAME: macos-latest-clang-xcode12

steps:
- name: Checkout code
uses: actions/checkout@v2

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.XCODE_VERSION }}

- name: build and test
shell: bash
env:
CMAKE_OPTIONS: ${{ matrix.CMAKE_OPTIONS }}
COMPILER: ${{ matrix.COMPILER }}
run: |
set -ex
# Set compiler and env variables
export CXX=${COMPILER}
${CXX} --version

# Build cereal and test
cmake --version
mkdir build && cd build
cmake ${CMAKE_OPTIONS} .. && make -j4 VERBOSE=1
ctest . --output-on-failure
195 changes: 195 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
name: Test cereal
on: [push, pull_request]

jobs:
test_cereal_linux:
runs-on: ubuntu-latest
container: ${{ matrix.CONTAINER }}
strategy:
fail-fast: false
matrix:
include:
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'g++-4.7'
EXTRA_APT_PACKAGES: 'g++-4.7'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++4.7

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'g++-4.8'
EXTRA_APT_PACKAGES: 'g++-4.8'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++4.8

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'g++-4.9'
EXTRA_APT_PACKAGES: 'g++-4.9'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++4.9

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'g++-5'
EXTRA_APT_PACKAGES: 'g++-5'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++4.5

- COMPILER: 'g++-5'
EXTRA_APT_PACKAGES: 'gcc-multilib g++-5-multilib linux-libc-dev'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++5-multilib

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'g++-6'
EXTRA_APT_PACKAGES: 'g++-6'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++6

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'g++-7'
EXTRA_APT_PACKAGES: 'g++-7'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++7

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'g++-8'
EXTRA_APT_PACKAGES: 'g++-8'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++8

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.5'
EXTRA_APT_PACKAGES: 'clang-3.5'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.5 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.5

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.6'
EXTRA_APT_PACKAGES: 'clang-3.6'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.6 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.6

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.7'
EXTRA_APT_PACKAGES: 'clang-3.7'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.7 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.7

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.8'
EXTRA_APT_PACKAGES: 'clang-3.8'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.8 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.8

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.9'
EXTRA_APT_PACKAGES: 'clang-3.9'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.9 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.9

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-4.0'
EXTRA_APT_PACKAGES: 'clang-4.0 g++-5'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-4.0

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-5.0'
EXTRA_APT_PACKAGES: 'clang-5.0 g++-7'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-5.0

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-5.0'
EXTRA_APT_PACKAGES: 'clang-5.0 g++-7'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-5.0-cpp17

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-7'
EXTRA_APT_PACKAGES: 'clang-7 g++-7'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-7-cpp17

- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17 -DCLANG_USE_LIBCPP=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'clang++-8'
EXTRA_APT_PACKAGES: 'clang-8 g++-8 libc++-8-dev libc++abi-8-dev'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-8-cpp17

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: install deps and test
shell: bash
env:
CMAKE_OPTIONS: ${{ matrix.CMAKE_OPTIONS }}
COMPILER: ${{ matrix.COMPILER }}
EXTRA_APT_PACKAGES: ${{ matrix.EXTRA_APT_PACKAGES }}
LLVM_APT_SOURCE: ${{ matrix.LLVM_APT_SOURCE }}
run: |
set -ex
# Add apt repositories
apt-get update -y
apt-get install software-properties-common wget python3-pip make apt-transport-https -y
add-apt-repository ppa:ubuntu-toolchain-r/test -y
add-apt-repository ppa:mhier/libboost-latest -y
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
if [[ "${LLVM_APT_SOURCE}" != "" ]]; then
add-apt-repository "${LLVM_APT_SOURCE}"
fi
apt-get update -y

# Install apt packages
apt-get install libboost-serialization-dev libboost-dev ${EXTRA_APT_PACKAGES} -y
pip3 install cmake

# Set compiler and env variables
export CXX=${COMPILER}
${CXX} --version
DEPS_DIR="${PWD}/deps"
mkdir -p "${DEPS_DIR}"
pushd "${DEPS_DIR}"
JOBS=2

# Install the right version of libc++
LLVM_INSTALL=${DEPS_DIR}/llvm/install
# if in linux and compiler clang and llvm not installed
if [[ "${CXX}" == "clang"* && -n "$(ls -A ${LLVM_INSTALL})" ]]; then
if [[ "${CXX}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2";
elif [[ "${CXX}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.1";
elif [[ "${CXX}" == "clang++-3.8" ]]; then LLVM_VERSION="3.8.1";
elif [[ "${CXX}" == "clang++-3.9" ]]; then LLVM_VERSION="3.9.1";
fi
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"
mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi
wget -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm
wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx
wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL})
(cd llvm/build/projects/libcxx && make install -j2)
(cd llvm/build/projects/libcxxabi && make install -j2)
export CXXFLAGS="-isystem ${LLVM_INSTALL}/include/c++/v1"
export LDFLAGS="-L ${LLVM_INSTALL}/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_INSTALL}/lib"
fi

popd

# Build cereal and test
cmake --version
mkdir build && cd build
cmake ${CMAKE_OPTIONS} .. && make -j4 VERBOSE=1
ctest . --output-on-failure
8 changes: 7 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ environment:
BOOST_ROOT: C:\Libraries\boost_1_66_0
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
VS_VERSION_MAJOR: 16
BOOST_ROOT: C:\Libraries\boost_1_71_0
BOOST_ROOT: C:\Libraries\boost_1_73_0
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
VS_VERSION_MAJOR: 17
BOOST_ROOT: C:\Libraries\boost_1_73_0

matrix:
exclude:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
platform: Win32

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
platform: Win32

platform:
- Win32
Expand Down
6 changes: 3 additions & 3 deletions scripts/appveyor.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ if not defined VS_VERSION_YEAR (
set VS_VERSION_YEAR=2017
) else if "%VS_VERSION_MAJOR%" == "16" (
set VS_VERSION_YEAR=2019
) else if "%VS_VERSION_MAJOR%" == "17" (
set VS_VERSION_YEAR=2022
) else (
@echo Cannot use Visual Studio version %VS_VERSION_MAJOR%
exit /b 1
Expand All @@ -39,10 +41,8 @@ if not defined CONFIGURATION (
@rem PLATFORM is (one of the entries) defined in appveyor.yml
if "%PLATFORM%"=="x64" (
set BIT_COUNT=64
set CMAKE_GENERATOR_NAME=%CMAKE_GENERATOR_PREFIX% Win64
) else (
set BIT_COUNT=32
set CMAKE_GENERATOR_NAME=%CMAKE_GENERATOR_PREFIX%
)

set BOOST_LIBRARYDIR=%BOOST_ROOT%\lib%BIT_COUNT%-msvc-%VS_VERSION_MAJOR%.0
Expand Down Expand Up @@ -72,7 +72,7 @@ if "%PLATFORM%" == "x64" (
rmdir /s /q CMakeFiles
)

cmake -G "%CMAKE_GENERATOR_NAME%" -DBOOST_ROOT=%BOOST_ROOT% -DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ..
cmake -G "%CMAKE_GENERATOR_PREFIX%" -A %PLATFORM% -DBOOST_ROOT=%BOOST_ROOT% -DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ..
@rem left the actual build for later - AppVeyor enables parallel jobs in a much cleaner way than msbuild

:done
Expand Down
Loading