1
0
Fork 0

Merge changes related to VS2019 support from IResearch upstream (#10258)

This commit is contained in:
KVS85 2019-10-15 17:28:06 +03:00 committed by GitHub
parent 4448ab2e62
commit bf0af83f17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 89 additions and 104 deletions

View File

@ -14,51 +14,6 @@ environment:
CMAKE_OPTIONS: -DUSE_TESTS=On -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DMSVC_BUILD_THREADS=16
CMAKE_BUILD_OPTIONS: --config %CONFIGURATION%
matrix:
############################################################################
# Visual Studio 2013
############################################################################
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
BUILD_TYPE: shared
TEST_OPTIONS: --gtest_filter=*type_utils*
VSINSTALL: "Microsoft Visual Studio 12.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_58_0
CONFIGURATION: Debug
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
BUILD_TYPE: static
TEST_OPTIONS: --gtest_filter=*type_utils*
VSINSTALL: "Microsoft Visual Studio 12.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_58_0
CONFIGURATION: Debug
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
BUILD_TYPE: shared
TEST_OPTIONS: --gtest_filter=*/fs___*:*/mmap___*
VSINSTALL: "Microsoft Visual Studio 12.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_58_0
CONFIGURATION: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
BUILD_TYPE: shared
TEST_OPTIONS: --gtest_filter=*:-:*/fs___*:-:*/mmap___*
VSINSTALL: "Microsoft Visual Studio 12.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_58_0
CONFIGURATION: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
BUILD_TYPE: static
TEST_OPTIONS: --gtest_filter=*/fs___*:*/mmap___*
VSINSTALL: "Microsoft Visual Studio 12.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_58_0
CONFIGURATION: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
BUILD_TYPE: static
TEST_OPTIONS: --gtest_filter=*:-:*/fs___*:-:*/mmap___*
VSINSTALL: "Microsoft Visual Studio 12.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_58_0
CONFIGURATION: Release
############################################################################
# Visual Studio 2015
@ -80,28 +35,14 @@ environment:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
BUILD_TYPE: shared
TEST_OPTIONS: --gtest_filter=*/fs___*:*/mmap___*:-:*europarl_docs* # tests with europarl_docs take longer than an hour on MSVC2015
VSINSTALL: "Microsoft Visual Studio 14.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_60_0
CONFIGURATION: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
BUILD_TYPE: shared
TEST_OPTIONS: --gtest_filter=*:-:*/fs___*:-:*/mmap___*
TEST_OPTIONS: --gtest_filter=*:-:*europarl*/fs*
VSINSTALL: "Microsoft Visual Studio 14.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_60_0
CONFIGURATION: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
BUILD_TYPE: static
TEST_OPTIONS: --gtest_filter=*/fs___*:*/mmap___*:-:*europarl_docs* # tests with europarl_docs take longer than an hour on MSVC2015
VSINSTALL: "Microsoft Visual Studio 14.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_60_0
CONFIGURATION: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
BUILD_TYPE: static
TEST_OPTIONS: --gtest_filter=*:-:*/fs___*:-:*/mmap___*
TEST_OPTIONS: --gtest_filter=*:-:*europarl*/fs* # tests with europarl_docs take longer than an hour on MSVC2015
VSINSTALL: "Microsoft Visual Studio 14.0\\VC"
BOOST_ROOT: C:/Libraries/boost_1_60_0
CONFIGURATION: Release
@ -126,33 +67,51 @@ environment:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_TYPE: shared
TEST_OPTIONS: --gtest_filter=*/fs___*:*/mmap___*:-:*europarl_docs* # tests with europarl_docs take longer than an hour on MSVC2017
TEST_OPTIONS: --gtest_filter=*:-:*europarl*/fs* # tests with europarl_docs take longer than an hour on MSVC2017
VSINSTALL: "Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build"
BOOST_ROOT: C:/Libraries/boost_1_64_0
CONFIGURATION: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_TYPE: static
TEST_OPTIONS: --gtest_filter=*:-:*europarl*/fs* # tests with europarl_docs take longer than an hour on MSVC2017
VSINSTALL: "Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build"
BOOST_ROOT: C:/Libraries/boost_1_64_0
CONFIGURATION: Release
############################################################################
# Visual Studio 2019
############################################################################
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: shared
TEST_OPTIONS: --gtest_filter=*:-:*/fs___*:-:*/mmap___*
VSINSTALL: "Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build"
BOOST_ROOT: C:/Libraries/boost_1_64_0
CONFIGURATION: Release
TEST_OPTIONS: --gtest_filter=*type_utils*
VSINSTALL: "Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build"
BOOST_ROOT: C:/Libraries/boost_1_71_0
CONFIGURATION: Debug
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: static
TEST_OPTIONS: --gtest_filter=*/fs___*:*/mmap___*:-:*europarl_docs* # tests with europarl_docs take longer than an hour on MSVC2017
VSINSTALL: "Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build"
BOOST_ROOT: C:/Libraries/boost_1_64_0
TEST_OPTIONS: --gtest_filter=*type_utils*
VSINSTALL: "Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build"
BOOST_ROOT: C:/Libraries/boost_1_71_0
CONFIGURATION: Debug
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: shared
TEST_OPTIONS: --gtest_filter=*:-:*europarl*/fs* # tests with europarl_docs take longer than an hour on MSVC2019
VSINSTALL: "Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build"
BOOST_ROOT: C:/Libraries/boost_1_71_0
CONFIGURATION: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_TYPE: static
TEST_OPTIONS: --gtest_filter=*:-:*/fs___*:-:*/mmap___*
VSINSTALL: "Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build"
BOOST_ROOT: C:/Libraries/boost_1_64_0
TEST_OPTIONS: --gtest_filter=*:-:*europarl*/fs* # tests with europarl_docs take longer than an hour on MSVC2019
VSINSTALL: "Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build"
BOOST_ROOT: C:/Libraries/boost_1_71_0
CONFIGURATION: Release
install:
install:
############################################################################
# All the dependencies are installed in %APPVEYOR_BUILD_FOLDER%\deps
############################################################################
@ -187,7 +146,7 @@ install:
############################################################################
- set ICU_DIR=%DEPS_DIR%\icu
- mkdir %ICU_DIR% && cd %ICU_DIR%
- set ICU_URL="https://ayera.dl.sourceforge.net/project/icu/ICU4C/57.1/icu4c-57_1-Win64-msvc10.zip"
- set ICU_URL="https://master.dl.sourceforge.net/project/icu/ICU4C/57.1/icu4c-57_1-Win64-msvc10.zip"
- appveyor DownloadFile %ICU_URL% -FileName icu4c-57_1-win64-msvc10.zip
- 7z x icu4c-57_1-win64-msvc10.zip -o. > nul
- set ICU_ROOT=%ICU_DIR%\icu
@ -217,7 +176,15 @@ install:
############################################################################
# Setup bison
############################################################################
- set PATH=C:\cygwin64\bin;%PATH%
# bison 2.7 from Win flex-bison 2.4.12 is the least to generate buildable
# parser.cc usable with Visual Studio 2019 image (has 3.4 bison via MSYS2)
- if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2019" (
appveyor DownloadFile https://excellmedia.dl.sourceforge.net/project/winflexbison/win_flex_bison-2.4.12.zip -FileName win_flex_bison-2.4.12.zip&
7z x win_flex_bison-2.4.12.zip -o"win_flex_bison-2.4.12" > nul&
mv win_flex_bison-2.4.12\win_bison.exe win_flex_bison-2.4.12\bison.exe&
set BISON_PATH=%cd%\win_flex_bison-2.4.12)
else (set BISON_PATH=C:\cygwin64\bin)
- set PATH=%BISON_PATH%;%PATH%
- bison --version
before_build:

View File

@ -151,6 +151,7 @@
// these versions produce incorrect code when inlining optimizations are enabled
// for versions @see https://github.com/lordmulder/MUtilities/blob/master/include/MUtils/Version.h
// and https://dev.to/yumetodo/list-of-mscver-and-mscfullver-8nd
// seems MSVC2019.0+ also have this problem
#if defined(_MSC_VER) \
&& !defined(_DEBUG) \
&& (((_MSC_FULL_VER >= 191125506) && (_MSC_FULL_VER <= 191125508)) \
@ -159,10 +160,11 @@
|| ((_MSC_FULL_VER >= 191326128) && (_MSC_FULL_VER <= 191326132)) \
|| ((_MSC_FULL_VER >= 191426430) && (_MSC_FULL_VER <= 191426433)) \
|| ((_MSC_FULL_VER >= 191526726) && (_MSC_FULL_VER <= 191526732)) \
|| ((_MSC_FULL_VER >= 191627023) && (_MSC_FULL_VER <= 191627032)))
#define MSVC2017_3456789_OPTIMIZED_WORKAROUND(...) __VA_ARGS__
|| ((_MSC_FULL_VER >= 191627023) && (_MSC_FULL_VER <= 191627034)) \
|| (_MSC_FULL_VER >= 192027508))
#define MSVC2017_3456789_MSVC2019_OPTIMIZED_WORKAROUND(...) __VA_ARGS__
#else
#define MSVC2017_3456789_OPTIMIZED_WORKAROUND(...)
#define MSVC2017_3456789_MSVC2019_OPTIMIZED_WORKAROUND(...)
#endif
// hook for MSVC-only code
@ -207,8 +209,12 @@
#define MSVC2017_ONLY(...)
#endif
// hook for MSVC2019-only code (2019.0 || 2019.1 || 2019.2 || 2019.3)
#if defined(_MSC_VER) \
&& (_MSC_VER == 1920)
&& (_MSC_VER == 1920 \
|| _MSC_VER == 1921 \
|| _MSC_VER == 1922 \
|| _MSC_VER == 1923)
#define MSVC2019_ONLY(...) __VA_ARGS__
#else
#define MSVC2019_ONLY(...)

View File

@ -476,11 +476,10 @@ template<
}
}; // attribute_map
// FIXME: find way to workaround `fatal error C1001: An internal error has
// occurred in the compiler (compiler file 'msc1.cpp', line 1527)` or change
// if fix is available in later Visual Studio 2019 updates
// Prevent using MSVS lett than 16.3 due to: `fatal error C1001: An internal
// error has occurred in the compiler (compiler file 'msc1.cpp', line 1527)`
#if defined _MSC_VER
static_assert(_MSC_VER < 1920, "_MSC_VER < 1920");
static_assert(_MSC_VER < 1920 || _MSC_VER >= 1923, "_MSC_VER < 1920 || _MSC_VER >= 1923");
#endif
template<typename T, template <typename, typename...> class Ref, typename... Args>
template<typename U>

View File

@ -897,7 +897,7 @@ class block_pool_sliced_inserter
// MSVC 2017.3 through 2017.9 incorectly count offsets if this function is inlined during optimization
// MSVC 2017.2 and below work correctly for both debug and release
MSVC2017_3456789_OPTIMIZED_WORKAROUND(__declspec(noinline))
MSVC2017_3456789_MSVC2019_OPTIMIZED_WORKAROUND(__declspec(noinline))
void write(const_pointer b, size_t len) {
// find end of the slice
for (; 0 == *where_ && len; --len, ++where_, ++b) {
@ -951,7 +951,7 @@ class block_pool_sliced_greedy_inserter
// At least MSVC 2017.9 incorectly process increment if this function is inlined during optimization
// Other MSVC 2017 versions could have similar issue
MSVC2017_3456789_OPTIMIZED_WORKAROUND(__declspec(noinline))
MSVC2017_3456789_MSVC2019_OPTIMIZED_WORKAROUND(__declspec(noinline))
block_pool_sliced_greedy_inserter& operator=(const_reference value) {
assert(!*where_); // we're not at the address part
@ -974,7 +974,7 @@ class block_pool_sliced_greedy_inserter
// MSVC 2017.3 through 2017.9 incorectly count offsets if this function is inlined during optimization
// MSVC 2017.2 and below work correctly for both debug and release
MSVC2017_3456789_OPTIMIZED_WORKAROUND(__declspec(noinline))
MSVC2017_3456789_MSVC2019_OPTIMIZED_WORKAROUND(__declspec(noinline))
void write(const_pointer b, size_t len) {
assert(!*where_); // we're not at the address part

View File

@ -33,7 +33,7 @@ void print_consolidation(
const irs::index_writer::consolidation_policy_t& policy
) {
struct less_t {
bool operator()(const irs::segment_meta* lhs, const irs::segment_meta* rhs) {
bool operator()(const irs::segment_meta* lhs, const irs::segment_meta* rhs) const {
return lhs->size == rhs->size ? lhs->name < rhs->name : lhs->size < rhs->size;
}
};

View File

@ -11423,9 +11423,10 @@ TEST_P(index_test_case, concurrent_add_remove_overlap_commit_mt) {
SCOPED_LOCK_NAMED(cond_mutex, cond_lock);
auto result = cond.wait_for(cond_lock, std::chrono::milliseconds(100)); // assume thread commits within 100 msec
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!stop && result == std::cv_status::no_timeout) result = cond.wait_for(cond_lock, std::chrono::milliseconds(100)));
MSVC2017_ONLY(while(!stop && result == std::cv_status::no_timeout) result = cond.wait_for(cond_lock, std::chrono::milliseconds(100)));
MSVC2019_ONLY(while(!stop && result == std::cv_status::no_timeout) result = cond.wait_for(cond_lock, std::chrono::milliseconds(100)));
// FIXME TODO add once segment_context will not block flush_all()
//ASSERT_TRUE(stop);
@ -11548,9 +11549,10 @@ TEST_P(index_test_case, document_context) {
auto result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100));
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!stop && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2017_ONLY(while(!stop && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2019_ONLY(while(!stop && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
ASSERT_EQ(std::cv_status::timeout, result); // verify commit() blocks
field_lock.unlock();
@ -11589,9 +11591,10 @@ TEST_P(index_test_case, document_context) {
auto result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)); // verify commit() blocks
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2017_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2019_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
ASSERT_EQ(std::cv_status::timeout, result);
field_lock.unlock();
@ -11636,9 +11639,10 @@ TEST_P(index_test_case, document_context) {
auto result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)); // verify commit() blocks
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2017_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2019_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
ASSERT_EQ(std::cv_status::timeout, result);
field_lock.unlock();
@ -11713,9 +11717,10 @@ TEST_P(index_test_case, document_context) {
auto result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(10000)); // verify commit() finishes FIXME TODO remove once segment_context will not block flush_all()
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request FIXME TODO remove once segment_context will not block flush_all()
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request FIXME TODO remove once segment_context will not block flush_all()
MSVC2015_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2017_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2019_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
ASSERT_EQ(std::cv_status::timeout, result); field_cond_lock.unlock(); // verify commit() finishes FIXME TODO use below once segment_context will not block flush_all()
//ASSERT_EQ(std::cv_status::no_timeout, result); // verify commit() finishes
@ -11770,9 +11775,10 @@ TEST_P(index_test_case, document_context) {
auto result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(10000)); // verify commit() finishes FIXME TODO remove once segment_context will not block flush_all()
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request FIXME TODO remove once segment_context will not block flush_all()
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request FIXME TODO remove once segment_context will not block flush_all()
MSVC2015_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2017_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2019_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
ASSERT_EQ(std::cv_status::timeout, result); field_cond_lock.unlock(); // verify commit() finishes FIXME TODO use below once segment_context will not block flush_all()
//ASSERT_EQ(std::cv_status::no_timeout, result); // verify commit() finishes
@ -11830,9 +11836,10 @@ TEST_P(index_test_case, document_context) {
auto result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(1000)); // verify commit() finishes FIXME TODO remove once segment_context will not block flush_all()
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request FIXME TODO remove once segment_context will not block flush_all()
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request FIXME TODO remove once segment_context will not block flush_all()
MSVC2015_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2017_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
MSVC2019_ONLY(while(!commit && result == std::cv_status::no_timeout) result = field.cond.wait_for(field_cond_lock, std::chrono::milliseconds(100)));
ASSERT_EQ(std::cv_status::timeout, result); field_cond_lock.unlock(); // verify commit() finishes FIXME TODO use below once segment_context will not block flush_all()
// ASSERT_EQ(std::cv_status::no_timeout, result); // verify commit() finishes
@ -21561,9 +21568,10 @@ TEST_P(index_test_case, segment_options) {
auto result = cond.wait_for(lock, std::chrono::milliseconds(1000)); // assume thread blocks in 1000ms
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!stop && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2017_ONLY(while(!stop && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2019_ONLY(while(!stop && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
ASSERT_EQ(std::cv_status::timeout, result);
// ^^^ expecting timeout because pool should block indefinitely

View File

@ -623,9 +623,10 @@ TEST_F(async_utils_tests, test_thread_pool_stop_mt) {
auto result = cond.wait_for(lock2, std::chrono::milliseconds(1000)); // assume thread blocks in 1000ms
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!stop && result == std::cv_status::no_timeout) result = cond2.wait_for(lock2, std::chrono::milliseconds(1000)));
MSVC2017_ONLY(while(!stop && result == std::cv_status::no_timeout) result = cond2.wait_for(lock2, std::chrono::milliseconds(1000)));
MSVC2019_ONLY(while(!stop && result == std::cv_status::no_timeout) result = cond2.wait_for(lock2, std::chrono::milliseconds(1000)));
ASSERT_EQ(std::cv_status::timeout, result);
// ^^^ expecting timeout because pool should block indefinitely
@ -648,4 +649,4 @@ TEST_F(async_utils_tests, test_thread_pool_stop_mt) {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -153,9 +153,10 @@ TEST(bounded_object_pool_tests, test_sobject_pool) {
auto result = cond.wait_for(lock, std::chrono::milliseconds(1000)); // assume thread blocks in 1000ms
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!emplace && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2017_ONLY(while(!emplace && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2019_ONLY(while(!emplace && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
ASSERT_EQ(std::cv_status::timeout, result);
// ^^^ expecting timeout because pool should block indefinitely
@ -227,9 +228,10 @@ TEST(bounded_object_pool_tests, test_sobject_pool) {
});
auto result = cond.wait_for(lock, std::chrono::milliseconds(1000)); // assume thread finishes in 1000ms
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!visit && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2017_ONLY(while(!visit && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2019_ONLY(while(!visit && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
obj.reset();
ASSERT_FALSE(obj);
@ -259,9 +261,10 @@ TEST(bounded_object_pool_tests, test_uobject_pool) {
auto result = cond.wait_for(lock, std::chrono::milliseconds(1000)); // assume thread blocks in 1000ms
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!emplace && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2017_ONLY(while(!emplace && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2019_ONLY(while(!emplace && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
ASSERT_EQ(std::cv_status::timeout, result);
// ^^^ expecting timeout because pool should block indefinitely
@ -333,9 +336,10 @@ TEST(bounded_object_pool_tests, test_uobject_pool) {
});
auto result = cond.wait_for(lock, std::chrono::milliseconds(1000)); // assume thread finishes in 1000ms
// MSVC 2015/2017 seems to sporadically notify condition variables without explicit request
// MSVC 2015/2017/2019 seems to sporadically notify condition variables without explicit request
MSVC2015_ONLY(while(!visit && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2017_ONLY(while(!visit && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
MSVC2019_ONLY(while(!visit && result == std::cv_status::no_timeout) result = cond.wait_for(lock, std::chrono::milliseconds(1000)));
obj.reset();
@ -1383,4 +1387,4 @@ TEST(concurrent_linked_list_test, concurrent_pop_push) {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------