summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/cmake/Variables.cmake1
-rw-r--r--indra/llcommon/CMakeLists.txt57
-rw-r--r--indra/llmath/CMakeLists.txt48
-rw-r--r--indra/llmessage/CMakeLists.txt57
-rw-r--r--indra/newview/CMakeLists.txt80
5 files changed, 125 insertions, 118 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index 6559051b5a..d4f9ed79de 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -24,6 +24,7 @@ set(SCRIPTS_PREFIX ../scripts)
set(SERVER_PREFIX)
set(VIEWER_PREFIX)
set(INTEGRATION_TESTS_PREFIX)
+set(LL_TESTS ON CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation")
set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX})
set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX})
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 416303342a..ca8d0829fa 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -265,33 +265,34 @@ target_link_libraries(
add_dependencies(llcommon stage_third_party_libs)
-include(LLAddBuildTest)
-SET(llcommon_TEST_SOURCE_FILES
- # unit-testing llcommon is not possible right now as the test-harness *itself* depends upon llcommon, causing a circular dependency. Add your 'unit' tests as integration tests for now.
- )
-LL_ADD_PROJECT_UNIT_TESTS(llcommon "${llcommon_TEST_SOURCE_FILES}")
-
-#set(TEST_DEBUG on)
-set(test_libs llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES} ${GOOGLEMOCK_LIBRARIES})
-LL_ADD_INTEGRATION_TEST(commonmisc "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(bitpack "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llbase64 "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(lldate "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(lldependencies "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llerror "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llframetimer "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llinstancetracker "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llstring "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(lltreeiterators "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(lluri "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(reflection "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}")
+if (LL_TESTS)
+ include(LLAddBuildTest)
+ SET(llcommon_TEST_SOURCE_FILES
+ # unit-testing llcommon is not possible right now as the test-harness *itself* depends upon llcommon, causing a circular dependency. Add your 'unit' tests as integration tests for now.
+ )
+ LL_ADD_PROJECT_UNIT_TESTS(llcommon "${llcommon_TEST_SOURCE_FILES}")
-# *TODO - reenable these once tcmalloc libs no longer break the build.
-#ADD_BUILD_TEST(llallocator llcommon)
-#ADD_BUILD_TEST(llallocator_heap_profile llcommon)
-#ADD_BUILD_TEST(llmemtype llcommon)
+ #set(TEST_DEBUG on)
+ set(test_libs llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES} ${GOOGLEMOCK_LIBRARIES})
+ LL_ADD_INTEGRATION_TEST(commonmisc "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(bitpack "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llbase64 "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(lldate "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(lldependencies "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llerror "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llframetimer "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llinstancetracker "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llstring "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(lltreeiterators "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(lluri "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(reflection "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}")
+ # *TODO - reenable these once tcmalloc libs no longer break the build.
+ #ADD_BUILD_TEST(llallocator llcommon)
+ #ADD_BUILD_TEST(llallocator_heap_profile llcommon)
+ #ADD_BUILD_TEST(llmemtype llcommon)
+endif (LL_TESTS)
diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt
index 7957c32be2..e93fe90650 100644
--- a/indra/llmath/CMakeLists.txt
+++ b/indra/llmath/CMakeLists.txt
@@ -86,27 +86,29 @@ list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES})
add_library (llmath ${llmath_SOURCE_FILES})
# Add tests
-include(LLAddBuildTest)
-# UNIT TESTS
-SET(llmath_TEST_SOURCE_FILES
- llbboxlocal.cpp
- llmodularmath.cpp
- llrect.cpp
- v2math.cpp
- v3color.cpp
- v4color.cpp
- v4coloru.cpp
- )
-LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}")
+if (LL_TESTS)
+ include(LLAddBuildTest)
+ # UNIT TESTS
+ SET(llmath_TEST_SOURCE_FILES
+ llbboxlocal.cpp
+ llmodularmath.cpp
+ llrect.cpp
+ v2math.cpp
+ v3color.cpp
+ v4color.cpp
+ v4coloru.cpp
+ )
+ LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}")
-# INTEGRATION TESTS
-set(test_libs llmath llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
-# TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests.
-LL_ADD_INTEGRATION_TEST(llbbox llbbox.cpp "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llquaternion llquaternion.cpp "${test_libs}")
-LL_ADD_INTEGRATION_TEST(mathmisc "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(m3math "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(v3dmath v3dmath.cpp "${test_libs}")
-LL_ADD_INTEGRATION_TEST(v3math v3math.cpp "${test_libs}")
-LL_ADD_INTEGRATION_TEST(v4math v4math.cpp "${test_libs}")
-LL_ADD_INTEGRATION_TEST(xform xform.cpp "${test_libs}")
+ # INTEGRATION TESTS
+ set(test_libs llmath llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
+ # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests.
+ LL_ADD_INTEGRATION_TEST(llbbox llbbox.cpp "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llquaternion llquaternion.cpp "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(mathmisc "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(m3math "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(v3dmath v3dmath.cpp "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(v3math v3math.cpp "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(v4math v4math.cpp "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(xform xform.cpp "${test_libs}")
+endif (LL_TESTS)
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt
index 779fc0c44f..912c97f714 100644
--- a/indra/llmessage/CMakeLists.txt
+++ b/indra/llmessage/CMakeLists.txt
@@ -218,36 +218,37 @@ target_link_libraries(
)
# tests
-
-SET(llmessage_TEST_SOURCE_FILES
- # llhttpclientadapter.cpp
- llmime.cpp
- llnamevalue.cpp
- lltrustedmessageservice.cpp
- lltemplatemessagedispatcher.cpp
+if (LL_TESTS)
+ SET(llmessage_TEST_SOURCE_FILES
+ # llhttpclientadapter.cpp
+ llmime.cpp
+ llnamevalue.cpp
+ lltrustedmessageservice.cpp
+ lltemplatemessagedispatcher.cpp
llregionpresenceverifier.cpp
- )
-LL_ADD_PROJECT_UNIT_TESTS(llmessage "${llmessage_TEST_SOURCE_FILES}")
-
-# set(TEST_DEBUG on)
-set(test_libs
- ${LLMESSAGE_LIBRARIES}
- ${WINDOWS_LIBRARIES}
- ${LLVFS_LIBRARIES}
- ${LLMATH_LIBRARIES}
- ${LLCOMMON_LIBRARIES}
+ )
+ LL_ADD_PROJECT_UNIT_TESTS(llmessage "${llmessage_TEST_SOURCE_FILES}")
+
+ # set(TEST_DEBUG on)
+ set(test_libs
+ ${LLMESSAGE_LIBRARIES}
+ ${WINDOWS_LIBRARIES}
+ ${LLVFS_LIBRARIES}
+ ${LLMATH_LIBRARIES}
+ ${LLCOMMON_LIBRARIES}
${GOOGLEMOCK_LIBRARIES}
- )
+ )
-LL_ADD_INTEGRATION_TEST(
- llsdmessage
- "llsdmessage.cpp"
- "${test_libs}"
- ${PYTHON_EXECUTABLE}
- "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llsdmessage_peer.py"
- )
+ LL_ADD_INTEGRATION_TEST(
+ llsdmessage
+ "llsdmessage.cpp"
+ "${test_libs}"
+ ${PYTHON_EXECUTABLE}
+ "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llsdmessage_peer.py"
+ )
-LL_ADD_INTEGRATION_TEST(llhost "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llpartdata "" "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llxfer_file "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llhost "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llpartdata "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llxfer_file "" "${test_libs}")
+endif (LL_TESTS)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index e632cbaaf2..fc6955bc70 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1651,48 +1651,50 @@ if (INSTALL)
include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake)
endif (INSTALL)
-# To add a viewer unit test, just add the test .cpp file below
-# This creates a separate test project per file listed.
-include(LLAddBuildTest)
-SET(viewer_TEST_SOURCE_FILES
- llagentaccess.cpp
- lldateutil.cpp
- llmediadataclient.cpp
- llviewerhelputil.cpp
- lllogininstance.cpp
- )
-set_source_files_properties(
- ${viewer_TEST_SOURCE_FILES}
- PROPERTIES
- LL_TEST_ADDITIONAL_SOURCE_FILES llviewerprecompiledheaders.cpp
- )
-LL_ADD_PROJECT_UNIT_TESTS(${VIEWER_BINARY_NAME} "${viewer_TEST_SOURCE_FILES}")
-
-#set(TEST_DEBUG on)
-set(test_sources llcapabilitylistener.cpp llviewerprecompiledheaders.cpp)
-set(test_libs
- ${LLMESSAGE_LIBRARIES}
- ${WINDOWS_LIBRARIES}
- ${LLVFS_LIBRARIES}
- ${LLMATH_LIBRARIES}
- ${LLCOMMON_LIBRARIES}
- ${GOOGLEMOCK_LIBRARIES}
+if (LL_TESTS)
+ # To add a viewer unit test, just add the test .cpp file below
+ # This creates a separate test project per file listed.
+ include(LLAddBuildTest)
+ SET(viewer_TEST_SOURCE_FILES
+ llagentaccess.cpp
+ lldateutil.cpp
+ llmediadataclient.cpp
+ llviewerhelputil.cpp
+ lllogininstance.cpp
)
+ set_source_files_properties(
+ ${viewer_TEST_SOURCE_FILES}
+ PROPERTIES
+ LL_TEST_ADDITIONAL_SOURCE_FILES llviewerprecompiledheaders.cpp
+ )
+ LL_ADD_PROJECT_UNIT_TESTS(${VIEWER_BINARY_NAME} "${viewer_TEST_SOURCE_FILES}")
-LL_ADD_INTEGRATION_TEST(llcapabilitylistener
- "${test_sources}"
- "${test_libs}"
- ${PYTHON_EXECUTABLE}
- "${CMAKE_SOURCE_DIR}/llmessage/tests/test_llsdmessage_peer.py"
- )
+ #set(TEST_DEBUG on)
+ set(test_sources llcapabilitylistener.cpp llviewerprecompiledheaders.cpp)
+ set(test_libs
+ ${LLMESSAGE_LIBRARIES}
+ ${WINDOWS_LIBRARIES}
+ ${LLVFS_LIBRARIES}
+ ${LLMATH_LIBRARIES}
+ ${LLCOMMON_LIBRARIES}
+ ${GOOGLEMOCK_LIBRARIES}
+ )
+
+ LL_ADD_INTEGRATION_TEST(llcapabilitylistener
+ "${test_sources}"
+ "${test_libs}"
+ ${PYTHON_EXECUTABLE}
+ "${CMAKE_SOURCE_DIR}/llmessage/tests/test_llsdmessage_peer.py"
+ )
-#ADD_VIEWER_BUILD_TEST(llmemoryview viewer)
-#ADD_VIEWER_BUILD_TEST(llagentaccess viewer)
-#ADD_VIEWER_BUILD_TEST(llworldmap viewer)
-#ADD_VIEWER_BUILD_TEST(llworldmipmap viewer)
-#ADD_VIEWER_BUILD_TEST(lltextureinfo viewer)
-#ADD_VIEWER_BUILD_TEST(lltextureinfodetails viewer)
-#ADD_VIEWER_BUILD_TEST(lltexturestatsuploader viewer)
+ #ADD_VIEWER_BUILD_TEST(llmemoryview viewer)
+ #ADD_VIEWER_BUILD_TEST(llagentaccess viewer)
+ #ADD_VIEWER_BUILD_TEST(llworldmap viewer)
+ #ADD_VIEWER_BUILD_TEST(llworldmipmap viewer)
+ #ADD_VIEWER_BUILD_TEST(lltextureinfo viewer)
+ #ADD_VIEWER_BUILD_TEST(lltextureinfodetails viewer)
+ #ADD_VIEWER_BUILD_TEST(lltexturestatsuploader viewer)
+endif (LL_TESTS)
# Don't do these for DARWIN or LINUX here -- they're taken care of by viewer_manifest.py