summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/interface/logging
diff options
context:
space:
mode:
authornadya73 <[email protected]>2024-07-02 23:10:50 +0300
committernadya73 <[email protected]>2024-07-02 23:21:03 +0300
commit5ea9afc5ee7edc24efa5f45b3a15e184872b0854 (patch)
tree4ccc339d97575cba8b3ed47b6f0615326bdb5324 /yt/cpp/mapreduce/interface/logging
parent96b239778766d32d5158aca805e08199b3c0a743 (diff)
[yt/cpp/mapreduce] YT-21595: Use gtest instead of ytest in all mapreduce tests
85671f0cf4f45b4f015fa2cc0d195b81c16c6e8a
Diffstat (limited to 'yt/cpp/mapreduce/interface/logging')
-rw-r--r--yt/cpp/mapreduce/interface/logging/ut/log_ut.cpp19
-rw-r--r--yt/cpp/mapreduce/interface/logging/ut/ya.make11
-rw-r--r--yt/cpp/mapreduce/interface/logging/ya.make4
3 files changed, 34 insertions, 0 deletions
diff --git a/yt/cpp/mapreduce/interface/logging/ut/log_ut.cpp b/yt/cpp/mapreduce/interface/logging/ut/log_ut.cpp
new file mode 100644
index 00000000000..b79b2f707f1
--- /dev/null
+++ b/yt/cpp/mapreduce/interface/logging/ut/log_ut.cpp
@@ -0,0 +1,19 @@
+#include <yt/cpp/mapreduce/interface/logging/logger.h>
+
+#include <library/cpp/testing/gtest/gtest.h>
+
+#include <util/string/cast.h>
+
+using namespace NYT;
+
+TEST(TLoggingTest, FromString) {
+ EXPECT_EQ(FromString("error"), ILogger::ELevel::ERROR);
+ EXPECT_EQ(FromString("warning"), ILogger::ELevel::ERROR);
+ EXPECT_EQ(FromString("info"), ILogger::ELevel::INFO);
+ EXPECT_EQ(FromString("debug"), ILogger::ELevel::DEBUG);
+ EXPECT_EQ(FromString("ERROR"), ILogger::ELevel::ERROR);
+ EXPECT_EQ(FromString("WARNING"), ILogger::ELevel::ERROR);
+ EXPECT_EQ(FromString("INFO"), ILogger::ELevel::INFO);
+ EXPECT_EQ(FromString("DEBUG"), ILogger::ELevel::DEBUG);
+ EXPECT_THROW(FromString<ILogger::ELevel>("no"), yexception);
+}
diff --git a/yt/cpp/mapreduce/interface/logging/ut/ya.make b/yt/cpp/mapreduce/interface/logging/ut/ya.make
new file mode 100644
index 00000000000..53d94509fb8
--- /dev/null
+++ b/yt/cpp/mapreduce/interface/logging/ut/ya.make
@@ -0,0 +1,11 @@
+GTEST()
+
+SRCS(
+ log_ut.cpp
+)
+
+PEERDIR(
+ yt/cpp/mapreduce/interface/logging
+)
+
+END()
diff --git a/yt/cpp/mapreduce/interface/logging/ya.make b/yt/cpp/mapreduce/interface/logging/ya.make
index 8095bfe4bae..03407caf14b 100644
--- a/yt/cpp/mapreduce/interface/logging/ya.make
+++ b/yt/cpp/mapreduce/interface/logging/ya.make
@@ -14,3 +14,7 @@ PEERDIR(
GENERATE_ENUM_SERIALIZATION(logger.h)
END()
+
+RECURSE_FOR_TESTS(
+ ut
+)