Disable tests that are broken on windows

This commit is contained in:
Sebastian Messmer 2021-12-11 23:06:01 +01:00
parent b01f498a58
commit 875f55ee41

View File

@ -9,6 +9,9 @@
using namespace cpputils::logging; using namespace cpputils::logging;
using std::string; using std::string;
// Disable the next tests for MSVC debug builds since writing to stderr doesn't seem to work well there
#if !defined(_MSC_VER) || NDEBUG
TEST_F(LoggingTest, DefaultLoggerIsStderr) { TEST_F(LoggingTest, DefaultLoggerIsStderr) {
string output = captureStderr([]{ string output = captureStderr([]{
LOG(INFO, "My log message"); LOG(INFO, "My log message");
@ -30,6 +33,8 @@ TEST_F(LoggingTest, SetLogger_NewLoggerIsUsed) {
EXPECT_TRUE(std::regex_search(output, std::regex(".*\\[MyTestLog2\\].*\\[info\\].*My log message.*"))); EXPECT_TRUE(std::regex_search(output, std::regex(".*\\[MyTestLog2\\].*\\[info\\].*My log message.*")));
} }
#endif
TEST_F(LoggingTest, SetNonStderrLogger_LogsToNewLogger) { TEST_F(LoggingTest, SetNonStderrLogger_LogsToNewLogger) {
setLogger(mockLogger.get()); setLogger(mockLogger.get());
logger()->info("My log message"); logger()->info("My log message");