aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/common/ut/env_ut.cpp
diff options
context:
space:
mode:
authorbulatman <bulatman@yandex-team.ru>2022-02-10 16:45:50 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:50 +0300
commit2f6ca198245aeffd5e2d82b65927c2465b68b4f5 (patch)
tree9142afc54d335ea52910662635b898e79e192e49 /library/cpp/testing/common/ut/env_ut.cpp
parent6560e4993b14d193f8c879e33a3de5e5eba6e21d (diff)
downloadydb-2f6ca198245aeffd5e2d82b65927c2465b68b4f5.tar.gz
Restoring authorship annotation for <bulatman@yandex-team.ru>. 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.cpp156
1 files changed, 78 insertions, 78 deletions
diff --git a/library/cpp/testing/common/ut/env_ut.cpp b/library/cpp/testing/common/ut/env_ut.cpp
index 889e8073e8..2aed1e4a25 100644
--- a/library/cpp/testing/common/ut/env_ut.cpp
+++ b/library/cpp/testing/common/ut/env_ut.cpp
@@ -1,104 +1,104 @@
-#include <library/cpp/testing/common/env.h>
-#include <library/cpp/testing/common/scope.h>
+#include <library/cpp/testing/common/env.h>
+#include <library/cpp/testing/common/scope.h>
#include <library/cpp/testing/gtest/gtest.h>
-
-#include <util/folder/dirut.h>
+
+#include <util/folder/dirut.h>
#include <util/stream/file.h>
-#include <util/system/env.h>
-#include <util/system/execpath.h>
+#include <util/system/env.h>
+#include <util/system/execpath.h>
#include <util/system/fs.h>
-
-
-TEST(Runtime, ArcadiaSourceRoot) {
+
+
+TEST(Runtime, ArcadiaSourceRoot) {
NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", ""); // remove context filename
- {
- auto tmpDir = ::GetSystemTempDir();
- NTesting::TScopedEnvironment guard("ARCADIA_SOURCE_ROOT", tmpDir);
+ {
+ auto tmpDir = ::GetSystemTempDir();
+ NTesting::TScopedEnvironment guard("ARCADIA_SOURCE_ROOT", tmpDir);
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_EQ(tmpDir, ArcadiaSourceRoot());
- }
- {
- NTesting::TScopedEnvironment guard("ARCADIA_SOURCE_ROOT", "");
+ EXPECT_EQ(tmpDir, ArcadiaSourceRoot());
+ }
+ {
+ NTesting::TScopedEnvironment guard("ARCADIA_SOURCE_ROOT", "");
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_FALSE(ArcadiaSourceRoot().empty());
- }
-}
-
-TEST(Runtime, BuildRoot) {
+ EXPECT_FALSE(ArcadiaSourceRoot().empty());
+ }
+}
+
+TEST(Runtime, BuildRoot) {
NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", ""); // remove context filename
- {
- auto tmpDir = ::GetSystemTempDir();
- NTesting::TScopedEnvironment guard("ARCADIA_BUILD_ROOT", tmpDir);
+ {
+ auto tmpDir = ::GetSystemTempDir();
+ NTesting::TScopedEnvironment guard("ARCADIA_BUILD_ROOT", tmpDir);
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_EQ(tmpDir, BuildRoot());
- }
- {
- NTesting::TScopedEnvironment guard("ARCADIA_BUILD_ROOT", "");
+ EXPECT_EQ(tmpDir, BuildRoot());
+ }
+ {
+ NTesting::TScopedEnvironment guard("ARCADIA_BUILD_ROOT", "");
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_FALSE(BuildRoot().empty());
- }
-}
-
-TEST(Runtime, BinaryPath) {
+ EXPECT_FALSE(BuildRoot().empty());
+ }
+}
+
+TEST(Runtime, BinaryPath) {
NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", ""); // remove context filename
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_TRUE(TFsPath(BinaryPath("library/cpp/testing/common/ut")).Exists());
-}
-
-TEST(Runtime, GetArcadiaTestsData) {
+ EXPECT_TRUE(TFsPath(BinaryPath("library/cpp/testing/common/ut")).Exists());
+}
+
+TEST(Runtime, GetArcadiaTestsData) {
NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", ""); // remove context filename
- {
- auto tmpDir = ::GetSystemTempDir();
- NTesting::TScopedEnvironment guard("ARCADIA_TESTS_DATA_DIR", tmpDir);
+ {
+ auto tmpDir = ::GetSystemTempDir();
+ NTesting::TScopedEnvironment guard("ARCADIA_TESTS_DATA_DIR", tmpDir);
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_EQ(tmpDir, GetArcadiaTestsData());
- }
- {
- NTesting::TScopedEnvironment guard("ARCADIA_TESTS_DATA_DIR", "");
+ EXPECT_EQ(tmpDir, GetArcadiaTestsData());
+ }
+ {
+ NTesting::TScopedEnvironment guard("ARCADIA_TESTS_DATA_DIR", "");
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- auto path = GetArcadiaTestsData();
- // it is not error if path is empty
- const bool ok = (path.empty() || GetBaseName(path) == "arcadia_tests_data");
- EXPECT_TRUE(ok);
- }
-}
-
-TEST(Runtime, GetWorkPath) {
+ auto path = GetArcadiaTestsData();
+ // it is not error if path is empty
+ const bool ok = (path.empty() || GetBaseName(path) == "arcadia_tests_data");
+ EXPECT_TRUE(ok);
+ }
+}
+
+TEST(Runtime, GetWorkPath) {
NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", ""); // remove context filename
- {
- auto tmpDir = ::GetSystemTempDir();
- NTesting::TScopedEnvironment guard("TEST_WORK_PATH", tmpDir);
+ {
+ auto tmpDir = ::GetSystemTempDir();
+ NTesting::TScopedEnvironment guard("TEST_WORK_PATH", tmpDir);
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_EQ(tmpDir, GetWorkPath());
- }
- {
- NTesting::TScopedEnvironment guard("TEST_WORK_PATH", "");
+ EXPECT_EQ(tmpDir, GetWorkPath());
+ }
+ {
+ NTesting::TScopedEnvironment guard("TEST_WORK_PATH", "");
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_TRUE(!GetWorkPath().empty());
- }
-}
-
-TEST(Runtime, GetOutputPath) {
+ EXPECT_TRUE(!GetWorkPath().empty());
+ }
+}
+
+TEST(Runtime, GetOutputPath) {
NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", ""); // remove context filename
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_EQ(GetOutputPath().Basename(), "testing_out_stuff");
-}
-
-TEST(Runtime, GetRamDrivePath) {
+ EXPECT_EQ(GetOutputPath().Basename(), "testing_out_stuff");
+}
+
+TEST(Runtime, GetRamDrivePath) {
NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", ""); // remove context filename
- auto tmpDir = ::GetSystemTempDir();
- NTesting::TScopedEnvironment guard("YA_TEST_RAM_DRIVE_PATH", tmpDir);
+ auto tmpDir = ::GetSystemTempDir();
+ NTesting::TScopedEnvironment guard("YA_TEST_RAM_DRIVE_PATH", tmpDir);
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_EQ(tmpDir, GetRamDrivePath());
-}
-
-TEST(Runtime, GetOutputRamDrivePath) {
+ EXPECT_EQ(tmpDir, GetRamDrivePath());
+}
+
+TEST(Runtime, GetOutputRamDrivePath) {
NTesting::TScopedEnvironment contextGuard("YA_TEST_CONTEXT_FILE", ""); // remove context filename
- auto tmpDir = ::GetSystemTempDir();
- NTesting::TScopedEnvironment guard("YA_TEST_OUTPUT_RAM_DRIVE_PATH", tmpDir);
+ auto tmpDir = ::GetSystemTempDir();
+ NTesting::TScopedEnvironment guard("YA_TEST_OUTPUT_RAM_DRIVE_PATH", tmpDir);
Singleton<NPrivate::TTestEnv>()->ReInitialize();
- EXPECT_EQ(tmpDir, GetOutputRamDrivePath());
-}
+ EXPECT_EQ(tmpDir, GetOutputRamDrivePath());
+}
#ifdef _linux_
TEST(Runtime, GdbPath) {