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 max_jobs: 2
image: image:
- Visual Studio 2017 - Visual Studio 2022
# - Visual Studio 2022 has failing test algorithm_project_test
branches: branches:
only: only:
@ -30,21 +29,9 @@ install:
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\histogram\ - 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 - 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 # prepare Boost build
- cmd /c bootstrap & b2 headers & cd libs\histogram - cmd /c bootstrap & cd libs\histogram
test_script: test_script:
# on windows # cxxstd=latest (aka 20) breaks VS 2022 in algorithm_project_test so we use cxxstd=17
- ..\..\b2 %B2_OPTS% cxxstd=latest test//minimal test//serialization - ..\..\b2 %B2_OPTS% cxxstd=17 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'))

View File

@ -29,13 +29,6 @@ jobs:
python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" histogram python tools/boostdep/depinst/depinst.py --git_args "--depth 5 --jobs 3" histogram
mv -f * $GITHUB_WORKSPACE 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 - name: Prepare b2
run: | run: |
./bootstrap.sh ./bootstrap.sh

View File

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

View File

@ -7,7 +7,9 @@
#ifndef BOOST_HISTOGRAM_DETAIL_DEBUG_HPP #ifndef BOOST_HISTOGRAM_DETAIL_DEBUG_HPP
#define 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 <boost/histogram/detail/type_name.hpp>
#include <iostream> #include <iostream>

View File

@ -177,14 +177,14 @@ int main() {
index_type index(ordered_1) { return true; } index_type index(ordered_1) { return true; }
}; };
struct ordered_2 { struct ordered_2 {
index_type index(int); index_type index(int) { return 0; };
}; };
struct not_ordered_1 { struct not_ordered_1 {
constexpr static bool ordered() { return false; } constexpr static bool ordered() { return false; }
index_type index(int); index_type index(int) { return 0; }
}; };
struct not_ordered_2 { 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>)); 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 // potentially ambiguous case that mimicks accumulators::weighted_sum
struct B4 { struct B4 {
B4(int) {} B4(int) {}
int operator+=(const weight_type<double>&); int operator+=(const weight_type<double>&) { return 0; }
int operator+=(const B4&); // *this += 0 succeeds as *this += B4(0) int operator+=(const B4&) { return 0; } // *this += 0 succeeds as *this += B4(0)
}; };
BOOST_TEST(dtl::accumulator_traits<B4>::weight_support); BOOST_TEST(dtl::accumulator_traits<B4>::weight_support);