Skip to content

Commit

Permalink
Skip only strptime dependent test in scan-test
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
  • Loading branch information
phprus committed Nov 26, 2022
1 parent a69e43c commit e12ea0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 HAVE_STRPTIME)
endif ()

add_fmt_test(std-test)
Expand Down
2 changes: 1 addition & 1 deletion test/scan-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ TEST(scan_test, read_string_view) {
EXPECT_EQ(s, "foo");
}

#ifndef _WIN32
#ifdef HAVE_STRPTIME
namespace fmt {
template <> struct scanner<tm> {
std::string format;
Expand Down

0 comments on commit e12ea0c

Please sign in to comment.