Skip to content

Commit 3806a9c

Browse files
committed
Added wchar api tests to windows
1 parent 4da9506 commit 3806a9c

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ build_script:
2626
2727
set PATH=C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
2828
29-
cmake .. -G %GENERATOR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DSPDLOG_BUILD_EXAMPLE=ON -DSPDLOG_BUILD_EXAMPLE_HO=ON -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=OFF
29+
cmake .. -G %GENERATOR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DSPDLOG_WCHAR_SUPPORT=ON -DSPDLOG_BUILD_EXAMPLE=ON -DSPDLOG_BUILD_EXAMPLE_HO=ON -DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=OFF
3030
3131
cmake --build . --config %BUILD_TYPE%
3232

tests/test_stdout_api.cpp

+19-1
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,22 @@ TEST_CASE("stderr_color_mt", "[stderr]")
7777
l->error("Test stderr_color_mt");
7878
l->critical("Test stderr_color_mt");
7979
spdlog::drop_all();
80-
}
80+
}
81+
82+
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
83+
84+
TEST_CASE("wchar_api", "[stdout]")
85+
{
86+
auto l = spdlog::stdout_logger_st("wchar_logger");
87+
l->set_pattern("%+");
88+
l->set_level(spdlog::level::trace);
89+
l->trace(L"Test wchar_api");
90+
l->trace(L"Test wchar_api {}", L"param");
91+
l->trace(L"Test wchar_api {}", 1);
92+
l->trace(L"Test wchar_api {}", std::wstring{L"wstring param"});
93+
l->trace(std::wstring{L"Test wchar_api wstring"});
94+
95+
spdlog::drop_all();
96+
}
97+
98+
#endif

0 commit comments

Comments
 (0)