Skip to content

Commit b6194b4

Browse files
Execute filesystem path unit tests only on the current platform.
1 parent d8401f4 commit b6194b4

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

sdk/tests/src/test_argparse_argument_base.cpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -254,21 +254,8 @@ TEST_F(test_argparse_argument_base, convert_vector_double)
254254
EXPECT_THROW(arg.convert_wrapper("1,a,b,c,d,e"), std::runtime_error);
255255
}
256256

257-
TEST_F(test_argparse_argument_base, convert_filesystem_path_unix)
258-
{
259-
using Type = std::filesystem::path;
260-
argument<Type> arg("name_long");
261-
262-
EXPECT_EQ(Type{}, arg.convert_wrapper(""));
263-
264-
const auto non_spaced_path = std::filesystem::path("/home/TeiaCare/DummyDirectory/log.txt");
265-
EXPECT_EQ(arg.convert_wrapper("/home/TeiaCare/DummyDirectory/log.txt"), non_spaced_path);
266-
267-
const auto spaced_path = std::filesystem::path("/home/TeiaCare/Dummy Directory/log.txt");
268-
EXPECT_EQ(arg.convert_wrapper("/home/TeiaCare/Dummy Directory/log.txt"), spaced_path);
269-
}
270-
271-
TEST_F(test_argparse_argument_base, convert_filesystem_path_windows)
257+
#if defined(WIN32)
258+
TEST_F(test_argparse_argument_base, convert_filesystem_path)
272259
{
273260
using Type = std::filesystem::path;
274261
argument<Type> arg("name_long");
@@ -285,5 +272,20 @@ TEST_F(test_argparse_argument_base, convert_filesystem_path_windows)
285272
EXPECT_EQ(arg.convert_wrapper(R"(C:\TeiaCare\Dummy Directory\log.txt)"), spaced_path);
286273
EXPECT_EQ(arg.convert_wrapper(R"(C:/TeiaCare/Dummy Directory/log.txt)"), spaced_path);
287274
}
275+
#else
276+
TEST_F(test_argparse_argument_base, convert_filesystem_path)
277+
{
278+
using Type = std::filesystem::path;
279+
argument<Type> arg("name_long");
280+
281+
EXPECT_EQ(Type{}, arg.convert_wrapper(""));
282+
283+
const auto non_spaced_path = std::filesystem::path("/home/TeiaCare/DummyDirectory/log.txt");
284+
EXPECT_EQ(arg.convert_wrapper("/home/TeiaCare/DummyDirectory/log.txt"), non_spaced_path);
285+
286+
const auto spaced_path = std::filesystem::path("/home/TeiaCare/Dummy Directory/log.txt");
287+
EXPECT_EQ(arg.convert_wrapper("/home/TeiaCare/Dummy Directory/log.txt"), spaced_path);
288+
}
289+
#endif
288290

289291
}

0 commit comments

Comments
 (0)