From 477fb26c1ef458b6b552c7ac42bd0f18a483770f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 18 Jun 2010 17:38:21 -0400 Subject: Centralize LD_LIBRARY_PATH logic with new SET_TEST_PATH macro. Add ${SHARED_LIB_STAGING_DIR_RELEASE} to LD_LIBRARY_PATH for executing tests: otherwise Debug-build tests can't find (e.g.) the aprutil DLL, for which we don't build/package a debug variant. Leverage discovery that a CMake macro can accept a target variable name argument for LL_TEST_COMMAND macro. --- indra/test/CMakeLists.txt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index c1360987a5..955c77c041 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -13,6 +13,7 @@ include(LLXML) include(LScript) include(Linking) include(Tut) +include(LLAddBuildTest) include(GoogleMock) @@ -117,19 +118,12 @@ endif (WINDOWS) get_target_property(TEST_EXE test LOCATION) -IF(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) -ELSEIF(DARWIN) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib) -ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib) -ENDIF(WINDOWS) - -LL_TEST_COMMAND("${LD_LIBRARY_PATH}" +SET_TEST_PATH(LD_LIBRARY_PATH) +LL_TEST_COMMAND(command "${LD_LIBRARY_PATH}" "${TEST_EXE}" "--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt" "--touch=${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt") ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt - COMMAND ${LL_TEST_COMMAND_value} + COMMAND ${command} DEPENDS test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "C++ unit tests" -- cgit v1.3 From edb999ab03006f7713db43b5c1e2d458b1ec8cfe Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 21 Jun 2010 17:02:16 -0400 Subject: Remove tab chars inherited with file... --- indra/cmake/LLAddBuildTest.cmake | 2 +- indra/cmake/LLSharedLibs.cmake | 8 ++++---- indra/test/CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/test') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index dd49caaf20..e8a0a949b6 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -137,7 +137,7 @@ INCLUDE(GoogleMock) SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt) SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}) - # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19 + # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19 IF(LL_TEST_VERBOSE) MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}") ENDIF(LL_TEST_VERBOSE) diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake index 009eeae781..e29076c738 100644 --- a/indra/cmake/LLSharedLibs.cmake +++ b/indra/cmake/LLSharedLibs.cmake @@ -8,18 +8,18 @@ macro(ll_deploy_sharedlibs_command target_exe) SET_TEST_PATH(SEARCH_DIRS) get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE) if(IS_BUNDLE) - # If its a bundle the exe is not in the target location, this should find it. + # If its a bundle the exe is not in the target location, this should find it. get_filename_component(TARGET_FILE ${TARGET_LOCATION} NAME) set(OUTPUT_PATH ${TARGET_LOCATION}.app/Contents/MacOS) set(TARGET_LOCATION ${OUTPUT_PATH}/${TARGET_FILE}) - set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources) + set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources) endif(IS_BUNDLE) elseif(WINDOWS) SET_TEST_PATH(SEARCH_DIRS) LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32") elseif(LINUX) SET_TEST_PATH(SEARCH_DIRS) - set(OUTPUT_PATH ${OUTPUT_PATH}/lib) + set(OUTPUT_PATH ${OUTPUT_PATH}/lib) endif(DARWIN) add_custom_command( @@ -50,7 +50,7 @@ macro(ll_stage_sharedlib DSO_TARGET) else(DARWIN) set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) endif(DARWIN) - + # *TODO - maybe make this a symbolic link? -brad add_custom_command( TARGET ${DSO_TARGET} POST_BUILD diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 955c77c041..66c78a86c4 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -31,7 +31,7 @@ include_directories( set(test_SOURCE_FILES io.cpp -# llapp_tut.cpp # Temporarily removed until thread issues can be solved +# llapp_tut.cpp # Temporarily removed until thread issues can be solved llblowfish_tut.cpp llbuffer_tut.cpp lldoubledispatch_tut.cpp -- cgit v1.3