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

@ -168,7 +168,7 @@ if(MSVC)
)
set(RUN_ULT_CMD $<TARGET_FILE:${TARGET_NAME}>)
else()
set(RUN_ULT_CMD LD_LIBRARY_PATH=$<TARGET_FILE_DIR:${TARGET_NAME}> $<TARGET_FILE:${TARGET_NAME}>)
set(RUN_ULT_CMD $<TARGET_FILE:${TARGET_NAME}>)
endif()
add_dependencies(unit_tests ${TARGET_NAME})

View File

@ -145,9 +145,7 @@ if(MSVC)
)")
set(RUN_ULT_CMD $<TARGET_FILE:${TARGET_NAME}>)
else()
set(RUN_ULT_CMD LD_LIBRARY_PATH=$<TARGET_FILE_DIR:${TARGET_NAME}>
$<TARGET_FILE:${TARGET_NAME}>
)
set(RUN_ULT_CMD $<TARGET_FILE:${TARGET_NAME}>)
endif()
add_dependencies(unit_tests ${TARGET_NAME})

View File

@ -134,7 +134,7 @@ if(MSVC)
)
set(RUN_ULT_CMD $<TARGET_FILE:${TARGET_NAME}>)
else()
set(RUN_ULT_CMD LD_LIBRARY_PATH=$<TARGET_FILE_DIR:${TARGET_NAME}> $<TARGET_FILE:${TARGET_NAME}>)
set(RUN_ULT_CMD $<TARGET_FILE:${TARGET_NAME}>)
endif()
add_dependencies(unit_tests ${TARGET_NAME})

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

View File

@ -193,12 +193,19 @@ int main(int argc, char **argv) {
bool enable_abrt = 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