From 6f6e888c35c7f8ecb5278f4aa7faf8249e33da4f Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sat, 31 Aug 2024 17:33:58 +0200 Subject: [PATCH] Investigate VS2015 test error --- appveyor.yml | 39 +-------------------------------------- include/soci/logger.h | 7 ++++++- src/core/session.cpp | 4 ++++ tests/common-tests.cpp | 2 ++ 4 files changed, 13 insertions(+), 39 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index adf63206e..54d50703b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,33 +8,6 @@ configuration: Release environment: matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - G: "Ninja" - BOOST_ROOT: C:\Libraries\boost_1_84_0 - MSSQL_VER: 2019 - POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\15 - POSTGRESQL_VER: 15 - MYSQL_VER: 80 - MYSQL_DIR: C:\Program Files\MySql\MySQL Server 8.0 - VCVARS_SCRIPT: "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build" - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - G: "Ninja" - BOOST_ROOT: C:\Libraries\boost_1_77_0 - MSSQL_VER: 2017 - POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\13 - POSTGRESQL_VER: 13 - MYSQL_VER: 80 - MYSQL_DIR: C:\Program Files\MySql\MySQL Server 8.0 - VCVARS_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build" - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - G: "Ninja" - BOOST_ROOT: C:\Libraries\boost_1_69_0 - MSSQL_VER: 2016 - POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\12 - POSTGRESQL_VER: 12 - MYSQL_VER: 57 - MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7 - VCVARS_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 G: "Ninja" BOOST_ROOT: C:\Libraries\boost_1_60_0 @@ -44,16 +17,6 @@ environment: MYSQL_VER: 57 MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7 VCVARS_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC" - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - G: "MinGW Makefiles" - MINGW_BIN: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin - MSSQL_VER: 2014 - BOOST_ROOT: C:\Libraries\boost_1_60_0 - POSTGRESQL_ROOT: C:\Program Files\PostgreSQL\9.4 - POSTGRESQL_VER: 9.4 - MYSQL_VER: 57 - MYSQL_DIR: C:\Program Files\MySql\MySQL Server 5.7 - VCVARS_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC" install: # Start these ones here as we can't specify the service name dynamically above. @@ -132,7 +95,7 @@ build_script: - cmake --build . --config %CONFIGURATION% -- %BUILD_TOOL_OPTIONS% test_script: - - ctest -V --timeout 300 --output-on-failure --build-config %CONFIGURATION% --exclude-regex "%SOCI_ODBC_SKIP_TESTS%" + - ctest -V --timeout 300 --verbose --build-config %CONFIGURATION% --exclude-regex "%SOCI_ODBC_SKIP_TESTS%" # Uncomment this to wait for RDP connection after the build end. #on_finish: diff --git a/include/soci/logger.h b/include/soci/logger.h index f44e88459..77ba361a1 100644 --- a/include/soci/logger.h +++ b/include/soci/logger.h @@ -12,6 +12,8 @@ #include +#include + namespace soci { @@ -71,7 +73,10 @@ class SOCI_DECL logger // Methods used for the implementation of session basic logging support. void set_stream(std::ostream * s) { m_impl->set_stream(s); } std::ostream * get_stream() const { return m_impl->get_stream(); } - std::string get_last_query() const { return m_impl->get_last_query(); } + std::string get_last_query() const { + std::cerr << "Asking logger_impl (" << typeid(*m_impl).name() << ") for last query" << std::endl; + return m_impl->get_last_query(); + } private: logger_impl * m_impl; diff --git a/src/core/session.cpp b/src/core/session.cpp index f2e1bf34d..759e409ca 100644 --- a/src/core/session.cpp +++ b/src/core/session.cpp @@ -12,6 +12,8 @@ #include "soci/soci-backend.h" #include "soci/query_transformation.h" +#include + using namespace soci; using namespace soci::details; @@ -453,10 +455,12 @@ std::string session::get_last_query() const { if (isFromPool_) { + std::cerr << "Referring query retrieval to pooled session" << std::endl; return pool_->at(poolPosition_).get_last_query(); } else { + std::cerr << "Asking logger (" << typeid(logger_).name() << ") directly" << std::endl; return logger_.get_last_query(); } } diff --git a/tests/common-tests.cpp b/tests/common-tests.cpp index dce0b8f83..ea1b61bb1 100644 --- a/tests/common-tests.cpp +++ b/tests/common-tests.cpp @@ -2980,7 +2980,9 @@ TEST_CASE_METHOD(common_tests, "Basic logging support", "[core][logging]") } catch (...) {} + std::cerr << "Asking logger for last query..." << std::endl; CHECK(sql.get_last_query() == "drop table soci_test1"); + std::cerr << "Done asking" << std::endl; sql.set_log_stream(NULL);