MCPcopy Create free account
hub / github.com/Snapchat/Valdi / resolveRunfilesTestPath

Function resolveRunfilesTestPath

snap_drawing/test/utils/TestDataUtils.cpp:14–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12namespace {
13
14constexpr const char* testDataSubDir = "snap_drawing/testdata";
15
16Path resolveRunfilesTestPath(std::initializer_list<const char*> subDirsToCheck) {
17 char cwdBuffer[PATH_MAX];
18 (void)::getcwd(cwdBuffer, PATH_MAX);
19
20 auto cwdPath = Path(cwdBuffer);
21 Path basePath;
22
23 for (const auto& subDir : subDirsToCheck) {
24 basePath = cwdPath;
25 basePath.append(subDir);
26 basePath.append(testDataSubDir);
27 basePath.normalize();
28
29 if (DiskUtils::isDirectory(basePath)) {
30 return basePath;
31 }
32 }
33
34 return basePath;
35}
36

Callers 1

resolveTestPathFunction · 0.85

Calls 4

isDirectoryFunction · 0.85
appendMethod · 0.65
PathClass · 0.50
normalizeMethod · 0.45

Tested by

no test coverage detected