summaryrefslogtreecommitdiff
path: root/indra/test
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-03-31 11:57:48 -0500
committerDave Parks <davep@lindenlab.com>2023-03-31 11:57:48 -0500
commit7d144fcb2a1b0aff1b59e378c652649c3d03e94f (patch)
treede3bfe3ce90677cc4d7ab25b8aeaf5853c009068 /indra/test
parent0fe09bd968b987605123e99efb2fa040a988a942 (diff)
parente4173ea5cc1ef9b1677ac87a0f7c8acbe73414ee (diff)
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra/test')
-rw-r--r--indra/test/CMakeLists.txt73
-rw-r--r--indra/test/lldoubledispatch_tut.cpp11
2 files changed, 26 insertions, 58 deletions
diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt
index 084aa8d9f7..b7a39a7450 100644
--- a/indra/test/CMakeLists.txt
+++ b/indra/test/CMakeLists.txt
@@ -5,35 +5,12 @@ project (lltest)
include(00-Common)
include(LLCommon)
include(LLCoreHttp)
-include(LLInventory)
-include(LLMath)
-include(LLMessage)
-include(LLFileSystem)
-include(LLXML)
include(Linking)
include(Tut)
include(LLAddBuildTest)
include(bugsplat)
include(GoogleMock)
-include_directories(
- ${LLCOMMON_INCLUDE_DIRS}
- ${LLCOREHTTP_INCLUDE_DIRS}
- ${LLDATABASE_INCLUDE_DIRS}
- ${LLMATH_INCLUDE_DIRS}
- ${LLMESSAGE_INCLUDE_DIRS}
- ${LLINVENTORY_INCLUDE_DIRS}
- ${LLFILESYSTEM_INCLUDE_DIRS}
- ${LLXML_INCLUDE_DIRS}
- ${LSCRIPT_INCLUDE_DIRS}
- ${GOOGLEMOCK_INCLUDE_DIRS}
- ${TUT_INCLUDE_DIR}
- )
-include_directories(SYSTEM
- ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
- ${LLXML_SYSTEM_INCLUDE_DIRS}
- )
-
set(test_SOURCE_FILES
io.cpp
llapp_tut.cpp
@@ -76,39 +53,20 @@ if (NOT WINDOWS)
)
endif (NOT WINDOWS)
-set_source_files_properties(${test_HEADER_FILES}
- PROPERTIES HEADER_FILE_ONLY TRUE)
-
list(APPEND test_SOURCE_FILES ${test_HEADER_FILES})
add_executable(lltest ${test_SOURCE_FILES})
-if (USE_BUGSPLAT)
- set_target_properties(lltest PROPERTIES COMPILE_DEFINITIONS "${BUGSPLAT_DEFINE}")
-endif (USE_BUGSPLAT)
-
target_link_libraries(lltest
- ${LEGACY_STDIO_LIBS}
- ${LLDATABASE_LIBRARIES}
- ${LLINVENTORY_LIBRARIES}
- ${LLMESSAGE_LIBRARIES}
- ${LLMATH_LIBRARIES}
- ${LLFILESYSTEM_LIBRARIES}
- ${LLXML_LIBRARIES}
- ${LSCRIPT_LIBRARIES}
- ${LLCOMMON_LIBRARIES}
- ${LLCOREHTTP_LIBRARIES}
- ${EXPAT_LIBRARIES}
- ${GOOGLEMOCK_LIBRARIES}
- ${PTHREAD_LIBRARY}
- ${WINDOWS_LIBRARIES}
- ${BOOST_PROGRAM_OPTIONS_LIBRARY}
- ${BOOST_REGEX_LIBRARY}
- ${BOOST_FIBER_LIBRARY}
- ${BOOST_CONTEXT_LIBRARY}
- ${BOOST_SYSTEM_LIBRARY}
- ${DL_LIBRARY}
- )
+ llinventory
+ llmessage
+ llmath
+ llfilesystem
+ llxml
+ llcommon
+ llcorehttp
+ ll::googlemock
+ )
if (WINDOWS)
set_target_properties(lltest
@@ -120,10 +78,10 @@ endif (WINDOWS)
set(TEST_EXE $<TARGET_FILE:lltest>)
-SET_TEST_PATH(DYLD_LIBRARY_PATH)
+SET_TEST_PATH(LD_LIBRARY_PATH)
LL_TEST_COMMAND(command
- "${DYLD_LIBRARY_PATH}"
+ "${LD_LIBRARY_PATH}"
"${TEST_EXE}"
"--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt"
"--touch=${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt")
@@ -144,4 +102,13 @@ set(test_results ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt)
# developers choose to disable LL_TESTS.
if (LL_TESTS)
add_custom_target(tests_ok ALL DEPENDS ${test_results})
+ if(DARWIN)
+ # Support our "@executable_path/../Resources" load path for our test
+ # executable. This SHOULD properly be "$<TARGET_FILE_DIR:lltest>/Resources",
+ # but the CMake $<TARGET_FILE_DIR> generator expression isn't evaluated by
+ # CREATE_LINK, so fudge it.
+ add_custom_command( TARGET lltest POST_BUILD
+ COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources
+ )
+ endif()
endif (LL_TESTS)
diff --git a/indra/test/lldoubledispatch_tut.cpp b/indra/test/lldoubledispatch_tut.cpp
index ad8f6454d4..dbf55e666f 100644
--- a/indra/test/lldoubledispatch_tut.cpp
+++ b/indra/test/lldoubledispatch_tut.cpp
@@ -35,8 +35,9 @@
#include "lldoubledispatch.h"
// STL headers
// std headers
-#include <string>
#include <iostream>
+#include <memory>
+#include <string>
#include <typeinfo>
// external library headers
// other Linden headers
@@ -135,10 +136,10 @@ namespace tut
// Instantiate a few GameObjects. Make sure we refer to them
// polymorphically, and don't let them leak.
- std::auto_ptr<GameObject> home;
- std::auto_ptr<GameObject> obstacle;
- std::auto_ptr<GameObject> tug;
- std::auto_ptr<GameObject> patrol;
+ std::unique_ptr<GameObject> home;
+ std::unique_ptr<GameObject> obstacle;
+ std::unique_ptr<GameObject> tug;
+ std::unique_ptr<GameObject> patrol;
// prototype objects
Asteroid dummyAsteroid;