fix tests for msvc 2022 (#363)

This commit is contained in:
Hans Dembinski 2022-07-28 19:16:27 +02:00 committed by GitHub
parent 0718ae6f10
commit 4699dbc0e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 42 deletions

View File

@ -6,8 +6,7 @@ shallow_clone: true
max_jobs: 2
image:
- Visual Studio 2017
# - Visual Studio 2022 has failing test algorithm_project_test
- Visual Studio 2022
branches:
only:
@ -30,21 +29,9 @@ install:
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\histogram\
- python tools\boostdep\depinst\depinst.py -N units -N range -N accumulators --git_args "--depth 5 --jobs 2" histogram
## use hdembinski/serialization due to errors in boostorg/serialization
# - cd libs/serialization
# - git remote add patch https://github.com/HDembinski/serialization.git
# - git fetch patch
# - git checkout patch/boost_histogram
# - cd ../..
# prepare Boost build
- cmd /c bootstrap & b2 headers & cd libs\histogram
- cmd /c bootstrap & cd libs\histogram
test_script:
# on windows
- ..\..\b2 %B2_OPTS% cxxstd=latest test//minimal test//serialization
## Uncomment the following to stop VM and enable interactive login.
## Instructions how to log into the Appveyor VM are automatically printed.
# on_failure:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# cxxstd=latest (aka 20) breaks VS 2022 in algorithm_project_test so we use cxxstd=17
- ..\..\b2 %B2_OPTS% cxxstd=17 test//minimal test//serialization

View File

@ -29,13 +29,6 @@ jobs:
python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" histogram
mv -f * $GITHUB_WORKSPACE
# # use hdembinski/serialization due to frequent errors in boostorg/serialization
# pushd libs/serialization
# git remote add patch https://github.com/HDembinski/serialization.git
# git fetch patch
# git checkout patch/boost_histogram
# popd
- name: Prepare b2
run: |
./bootstrap.sh

View File

@ -51,9 +51,7 @@ jobs:
python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" histogram
mv -f * $GITHUB_WORKSPACE
- name: Prepare b2
run: |
./bootstrap.sh
./b2 headers
run: ./bootstrap.sh
- name: Test cxxstd=14 exception-handling=off rtti=off
run: |
cd libs/histogram
@ -80,9 +78,7 @@ jobs:
python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" histogram
mv -f * $GITHUB_WORKSPACE
- name: Prepare b2
run: |
./bootstrap.sh
./b2 headers
run: ./bootstrap.sh
- name: Test cxxstd=14 (warnings ignored)
run: |
cd libs/histogram
@ -102,9 +98,7 @@ jobs:
python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" histogram
mv -f * $GITHUB_WORKSPACE
- name: Prepare b2
run: |
./bootstrap.sh
./b2 headers
run: ./bootstrap.sh
- name: Test cxxstd=20 -O3 -funsafe-math-optimizations
run: |
cd libs/histogram
@ -124,9 +118,7 @@ jobs:
python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" histogram
mv -f * $GITHUB_WORKSPACE
- name: Prepare b2
run: |
./bootstrap.sh
./b2 headers
run: ./bootstrap.sh
- name: Test cxxstd=17 ubsan asan
run: |
cd libs/histogram

View File

@ -7,7 +7,9 @@
#ifndef BOOST_HISTOGRAM_DETAIL_DEBUG_HPP
#define BOOST_HISTOGRAM_DETAIL_DEBUG_HPP
#warning "debug.hpp included"
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("debug.hpp included")
#include <boost/histogram/detail/type_name.hpp>
#include <iostream>

View File

@ -177,14 +177,14 @@ int main() {
index_type index(ordered_1) { return true; }
};
struct ordered_2 {
index_type index(int);
index_type index(int) { return 0; };
};
struct not_ordered_1 {
constexpr static bool ordered() { return false; }
index_type index(int);
index_type index(int) { return 0; }
};
struct not_ordered_2 {
index_type index(not_ordered_2);
index_type index(not_ordered_2) { return 0; }
};
BOOST_TEST_TRAIT_TRUE((traits::is_ordered<ordered_1>));

View File

@ -98,8 +98,8 @@ int main() {
// potentially ambiguous case that mimicks accumulators::weighted_sum
struct B4 {
B4(int) {}
int operator+=(const weight_type<double>&);
int operator+=(const B4&); // *this += 0 succeeds as *this += B4(0)
int operator+=(const weight_type<double>&) { return 0; }
int operator+=(const B4&) { return 0; } // *this += 0 succeeds as *this += B4(0)
};
BOOST_TEST(dtl::accumulator_traits<B4>::weight_support);