MCPcopy Create free account
hub / github.com/catboost/catboost / ReInitialize

Method ReInitialize

library/cpp/testing/common/env.cpp:142–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 }
141
142 void TTestEnv::ReInitialize() {
143 IsRunningFromTest = false;
144 SourceRoot = "";
145 BuildRoot = "";
146 WorkPath = "";
147 RamDrivePath = "";
148 YtHddPath = "";
149 TestOutputRamDrivePath = "";
150 GdbPath = "";
151 CoreSearchFile = "";
152 EnvFile = "";
153 TestParameters.clear();
154 GlobalResources.clear();
155
156 const TString contextFilename = GetEnv("YA_TEST_CONTEXT_FILE");
157 if (contextFilename && TFsPath(contextFilename).Exists()) {
158 NJson::TJsonValue context;
159 NJson::ReadJsonTree(TFileInput(contextFilename).ReadAll(), &context);
160
161 NJson::TJsonValue* value;
162
163 value = context.GetValueByPath("runtime.source_root");
164 if (value) {
165 SourceRoot = value->GetStringSafe("");
166 }
167
168 value = context.GetValueByPath("runtime.build_root");
169 if (value) {
170 BuildRoot = value->GetStringSafe("");
171 }
172
173 value = context.GetValueByPath("runtime.work_path");
174 if (value) {
175 WorkPath = value->GetStringSafe("");
176 }
177
178 value = context.GetValueByPath("runtime.ram_drive_path");
179 if (value) {
180 RamDrivePath = value->GetStringSafe("");
181 }
182
183 value = context.GetValueByPath("runtime.yt_hdd_path");
184 if (value) {
185 YtHddPath = value->GetStringSafe("");
186 }
187
188 value = context.GetValueByPath("runtime.test_output_ram_drive_path");
189 if (value) {
190 TestOutputRamDrivePath = value->GetStringSafe("");
191 }
192
193 value = context.GetValueByPath("runtime.gdb_bin");
194 if (value) {
195 GdbPath = value->GetStringSafe("");
196 }
197
198 value = context.GetValueByPath("runtime.test_params");
199 if (value) {

Callers 2

TESTFunction · 0.80
ReInitializeContextFunction · 0.80

Calls 14

UnsetEnvFunction · 0.85
SetEnvFunction · 0.85
ReadAllMethod · 0.80
GetEnvFunction · 0.50
TFsPathClass · 0.50
ReadJsonTreeFunction · 0.50
TFileInputClass · 0.50
clearMethod · 0.45
ExistsMethod · 0.45
GetValueByPathMethod · 0.45
GetStringSafeMethod · 0.45
GetMapMethod · 0.45

Tested by

no test coverage detected