Skip to content

Commit

Permalink
Investigate VS2015 test error
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzmbrzl committed Sep 1, 2024
1 parent 6a106e7 commit 77d1c95
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 39 deletions.
39 changes: 1 addition & 38 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion include/soci/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include <ostream>

#include <iostream>

namespace soci
{

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/core/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "soci/soci-backend.h"
#include "soci/query_transformation.h"

#include <iostream>

using namespace soci;
using namespace soci::details;

Expand Down Expand Up @@ -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();
}
}
Expand Down
2 changes: 2 additions & 0 deletions tests/common-tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 77d1c95

Please sign in to comment.