Skip only strptime dependent test in scan-test

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
Vladislav Shchapov 2022-11-26 16:42:02 +05:00 committed by Victor Zverovich
parent 69ffedfe52
commit 74c51ff37e
2 changed files with 3 additions and 4 deletions

View File

@ -78,11 +78,10 @@ endif()
add_fmt_test(printf-test)
add_fmt_test(ranges-test ranges-odr-test.cc)
add_fmt_test(scan-test)
check_symbol_exists(strptime "time.h" HAVE_STRPTIME)
if (HAVE_STRPTIME)
add_fmt_test(scan-test)
else()
message(WARNING "Skipping scan-test due to missing strptime dependency.")
target_compile_definitions(scan-test PRIVATE FMT_HAVE_STRPTIME)
endif ()
add_fmt_test(std-test)

View File

@ -65,7 +65,7 @@ TEST(scan_test, read_string_view) {
EXPECT_EQ(s, "foo");
}
#ifndef _WIN32
#ifdef FMT_HAVE_STRPTIME
namespace fmt {
template <> struct scanner<tm> {
std::string format;