aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/common/ut/env_ut.cpp
diff options
context:
space:
mode:
authorAleksandr <ivansduck@gmail.com>2022-02-10 16:47:52 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:52 +0300
commitb05913d1c3c02a773578bceb7285084d2933ae86 (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /library/cpp/testing/common/ut/env_ut.cpp
parentea6c5b7f172becca389cacaff7d5f45f6adccbe6 (diff)
downloadydb-b05913d1c3c02a773578bceb7285084d2933ae86.tar.gz
Restoring authorship annotation for Aleksandr <ivansduck@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/testing/common/ut/env_ut.cpp')
-rw-r--r--library/cpp/testing/common/ut/env_ut.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/library/cpp/testing/common/ut/env_ut.cpp b/library/cpp/testing/common/ut/env_ut.cpp
index 408661d84d..2aed1e4a25 100644
--- a/library/cpp/testing/common/ut/env_ut.cpp
+++ b/library/cpp/testing/common/ut/env_ut.cpp
@@ -1,12 +1,12 @@
#include <library/cpp/testing/common/env.h>
#include <library/cpp/testing/common/scope.h>
-#include <library/cpp/testing/gtest/gtest.h>
+#include <library/cpp/testing/gtest/gtest.h>
#include <util/folder/dirut.h>
-#include <util/stream/file.h>
+#include <util/stream/file.h>
#include <util/system/env.h>
#include <util/system/execpath.h>
-#include <util/system/fs.h>
+#include <util/system/fs.h>
TEST(Runtime, ArcadiaSourceRoot) {
@@ -99,64 +99,64 @@ TEST(Runtime, GetOutputRamDrivePath) {
Singleton<NPrivate::TTestEnv>()->ReInitialize();
EXPECT_EQ(tmpDir, GetOutputRamDrivePath());
}
-
-#ifdef _linux_
-TEST(Runtime, GdbPath) {
- Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_TRUE(NFs::Exists(::GdbPath()));
-}
-#endif
-
-TString ReInitializeContext(TStringBuf data) {
- auto tmpDir = ::GetSystemTempDir();
- auto filename = tmpDir + "/context.json";
- TOFStream stream(filename);
- stream.Write(data.data(), data.size());
- stream.Finish();
-
- NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", filename);
- Singleton<NPrivate::TTestEnv>()->ReInitialize();
-
- return filename;
-}
-
-TEST(Runtime, GetTestParam) {
- TString context = R"json({
- "runtime": {
- "test_params": {
- "a": "b",
- "c": "d"
- }
- }
- })json";
- auto filename = ReInitializeContext(context);
-
- EXPECT_EQ("b", GetTestParam("a"));
- EXPECT_EQ("d", GetTestParam("c"));
- EXPECT_EQ("", GetTestParam("e"));
- EXPECT_EQ("w", GetTestParam("e", "w"));
-
- Singleton<NPrivate::TTestEnv>()->AddTestParam("e", "e");
- EXPECT_EQ("e", GetTestParam("e"));
-}
-
-TEST(Runtime, WatchProcessCore) {
- TString context = R"json({
- "internal": {
- "core_search_file": "watch_core.txt"
- }
- })json";
- auto filename = ReInitializeContext(context);
-
- WatchProcessCore(1, "bin1", "pwd");
- WatchProcessCore(2, "bin1");
- StopProcessCoreWatching(2);
-
- TIFStream file("watch_core.txt");
- auto data = file.ReadAll();
- TString expected = R"json({"cmd":"add","pid":1,"binary_path":"bin1","cwd":"pwd"}
-{"cmd":"add","pid":2,"binary_path":"bin1"}
-{"cmd":"drop","pid":2}
-)json";
- EXPECT_EQ(expected, data);
-}
+
+#ifdef _linux_
+TEST(Runtime, GdbPath) {
+ Singleton<NPrivate::TTestEnv>()->ReInitialize();
+ EXPECT_TRUE(NFs::Exists(::GdbPath()));
+}
+#endif
+
+TString ReInitializeContext(TStringBuf data) {
+ auto tmpDir = ::GetSystemTempDir();
+ auto filename = tmpDir + "/context.json";
+ TOFStream stream(filename);
+ stream.Write(data.data(), data.size());
+ stream.Finish();
+
+ NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", filename);
+ Singleton<NPrivate::TTestEnv>()->ReInitialize();
+
+ return filename;
+}
+
+TEST(Runtime, GetTestParam) {
+ TString context = R"json({
+ "runtime": {
+ "test_params": {
+ "a": "b",
+ "c": "d"
+ }
+ }
+ })json";
+ auto filename = ReInitializeContext(context);
+
+ EXPECT_EQ("b", GetTestParam("a"));
+ EXPECT_EQ("d", GetTestParam("c"));
+ EXPECT_EQ("", GetTestParam("e"));
+ EXPECT_EQ("w", GetTestParam("e", "w"));
+
+ Singleton<NPrivate::TTestEnv>()->AddTestParam("e", "e");
+ EXPECT_EQ("e", GetTestParam("e"));
+}
+
+TEST(Runtime, WatchProcessCore) {
+ TString context = R"json({
+ "internal": {
+ "core_search_file": "watch_core.txt"
+ }
+ })json";
+ auto filename = ReInitializeContext(context);
+
+ WatchProcessCore(1, "bin1", "pwd");
+ WatchProcessCore(2, "bin1");
+ StopProcessCoreWatching(2);
+
+ TIFStream file("watch_core.txt");
+ auto data = file.ReadAll();
+ TString expected = R"json({"cmd":"add","pid":1,"binary_path":"bin1","cwd":"pwd"}
+{"cmd":"add","pid":2,"binary_path":"bin1"}
+{"cmd":"drop","pid":2}
+)json";
+ EXPECT_EQ(expected, data);
+}