| 36 | namespace test { |
| 37 | |
| 38 | std::string CurrentExecutableDir() { |
| 39 | char result[PATH_MAX + 1] = {}; // readlink doesn't place a NULL terminator at the end of path |
| 40 | ssize_t count = readlink("/proc/self/exe", result, PATH_MAX); |
| 41 | if (count != -1) { |
| 42 | return dirname(result); |
| 43 | } |
| 44 | return {}; |
| 45 | } |
| 46 | |
| 47 | const std::string& DefaultGlobalLibPath() { |
| 48 | static const std::string path = [&]() -> std::string { |
no outgoing calls
no test coverage detected