Do not override LD_LIBRARY_PATH when running tests

Related-To: NEO-5632
Signed-off-by: Pawel Cieslak <pawel.cieslak@intel.com>
This commit is contained in:
Pawel Cieslak
2021-05-07 00:07:45 +00:00
committed by Compute-Runtime-Automation
parent a304e609fe
commit 5eae946fe3
5 changed files with 21 additions and 9 deletions

View File

@ -201,12 +201,19 @@ int main(int argc, char **argv) {
bool enable_segv = true;
if (getenv("IGDRCL_TEST_SELF_EXEC") == nullptr) {
std::string wd = getRunPath(argv[0]);
setenv("LD_LIBRARY_PATH", wd.c_str(), 1);
char *ldLibraryPath = getenv("LD_LIBRARY_PATH");
if (ldLibraryPath == nullptr) {
setenv("LD_LIBRARY_PATH", wd.c_str(), 1);
} else {
std::string ldLibraryPathConcat = wd + ":" + std::string(ldLibraryPath);
setenv("LD_LIBRARY_PATH", ldLibraryPathConcat.c_str(), 1);
}
setenv("IGDRCL_TEST_SELF_EXEC", wd.c_str(), 1);
execv(argv[0], argv);
printf("FATAL ERROR: cannot self-exec test: %s!, errno: %d\n", argv[0], errno);
return -1;
} else {
}
#endif