| 12 | namespace { |
| 13 | |
| 14 | constexpr const char* testDataSubDir = "snap_drawing/testdata"; |
| 15 | |
| 16 | Path 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 |
no test coverage detected