aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Rossetto <aaron.rossetto@ni.com>2021-01-14 10:59:12 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2021-01-22 11:38:41 -0600
commitea5a08dbc385c38688833fd04c6fe3fc142ea27b (patch)
tree407b9ee1ac2938b713bf1f1be525a4253b9a7dd0
parente9176649d1cfbbf114127bdc73a49e36406fccd8 (diff)
downloaduhd-ea5a08dbc385c38688833fd04c6fe3fc142ea27b.tar.gz
uhd-ea5a08dbc385c38688833fd04c6fe3fc142ea27b.tar.bz2
uhd-ea5a08dbc385c38688833fd04c6fe3fc142ea27b.zip
tests: Add lib/ to LD_LIBRARY_PATH for pytests
This commit sets the LD_LIBRARY_PATH environment variable when invoking pytests to ensure that Python tests that use bindings to UHD in libpyuhd.so can link to new symbols in libuhd.so without the need to have UHD installed.
-rw-r--r--host/cmake/Modules/UHDUnitTest.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/host/cmake/Modules/UHDUnitTest.cmake b/host/cmake/Modules/UHDUnitTest.cmake
index d477dc966..519be9ca0 100644
--- a/host/cmake/Modules/UHDUnitTest.cmake
+++ b/host/cmake/Modules/UHDUnitTest.cmake
@@ -131,6 +131,11 @@ function(UHD_ADD_PYTEST test_name)
)
endif(ENABLE_QEMU_UNITTESTS)
# Include ${CMAKE_BINARY_DIR}/utils/ for testing the python utils
- set_tests_properties(${test_name} PROPERTIES
- ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR}/tests/common:${CMAKE_BINARY_DIR}/utils/)
+ if(APPLE)
+ set_tests_properties(${test_name} PROPERTIES
+ ENVIRONMENT "DYLD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib/;PYTHONPATH=${CMAKE_SOURCE_DIR}/tests/common:${CMAKE_BINARY_DIR}/utils/")
+ else()
+ set_tests_properties(${test_name} PROPERTIES
+ ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib/;PYTHONPATH=${CMAKE_SOURCE_DIR}/tests/common:${CMAKE_BINARY_DIR}/utils/")
+ endif()
endfunction(UHD_ADD_PYTEST)