Skip to content
Snippets Groups Projects
Commit ac63aaf7 authored by Adam Moss's avatar Adam Moss
Browse files

DEV-41080

The unit testing framework itself doesn't (shouldn't) depend upon llmath, so relax that dependancy when we're actually testing llmath itself.
This makes llmath unit-testable.
Subsequently, upgrade some of the llmath Integration tests to something much closer to Unit tests (hooray).
parent c0174554
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) ...@@ -11,7 +11,7 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
# #
# More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code # More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code
# #
# WARNING: do NOT modify this code without working with poppy or daveh - # WARNING: do NOT modify this code without working with poppy -
# there is another branch that will conflict heavily with any changes here. # there is another branch that will conflict heavily with any changes here.
IF(LL_TEST_VERBOSE) IF(LL_TEST_VERBOSE)
...@@ -23,11 +23,20 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) ...@@ -23,11 +23,20 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
# Setup includes, paths, etc # Setup includes, paths, etc
SET(alltest_SOURCE_FILES SET(alltest_SOURCE_FILES
${CMAKE_SOURCE_DIR}/test/test.cpp ${CMAKE_SOURCE_DIR}/test/test.cpp
${CMAKE_SOURCE_DIR}/test/lltut.cpp
) )
SET(alltest_DEP_TARGETS SET(alltest_DEP_TARGETS
# needed by the test harness itself
${APRUTIL_LIBRARIES}
${APR_LIBRARIES}
llcommon llcommon
llmath
) )
IF(NOT "${project}" STREQUAL "llmath")
# add llmath as a dep unless the tested module *is* llmath!
LIST(APPEND alltest_DEP_TARGETS
llmath
)
ENDIF(NOT "${project}" STREQUAL "llmath")
SET(alltest_INCLUDE_DIRS SET(alltest_INCLUDE_DIRS
${LLMATH_INCLUDE_DIRS} ${LLMATH_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS} ${LLCOMMON_INCLUDE_DIRS}
......
...@@ -85,24 +85,21 @@ add_library (llmath ${llmath_SOURCE_FILES}) ...@@ -85,24 +85,21 @@ add_library (llmath ${llmath_SOURCE_FILES})
# Add tests # Add tests
include(LLAddBuildTest) include(LLAddBuildTest)
SET(llmath_TEST_SOURCE_FILES SET(llmath_TEST_SOURCE_FILES
# nat 2009-08-28: found this commented out and considered implementing it llrect.cpp
# using LL_ADD_INTEGRATION_TEST, but there's no llvolume_test.cpp source? v2math.cpp
# llvolume.cpp v3color.cpp
v4coloru.cpp
) )
LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}") LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}")
set(test_libs llmath llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES}) set(test_libs llmath llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
# some of these are probably pretty decent *unit* tests rather than integration tests, but I have to work out a CMake whining puzzle. # 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(llbbox llbbox.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(llbboxlocal llbboxlocal.cpp "${test_libs}") LL_ADD_INTEGRATION_TEST(llbboxlocal llbboxlocal.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(mathmisc "" "${test_libs}") LL_ADD_INTEGRATION_TEST(mathmisc "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llrect "llrect.cpp" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llquaternion llquaternion.cpp "${test_libs}") LL_ADD_INTEGRATION_TEST(llquaternion llquaternion.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(v2math v2math.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(v3color v3color.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(v3dmath v3dmath.cpp "${test_libs}") LL_ADD_INTEGRATION_TEST(v3dmath v3dmath.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(v3math v3math.cpp "${test_libs}") LL_ADD_INTEGRATION_TEST(v3math v3math.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(v4color v4color.cpp "${test_libs}") LL_ADD_INTEGRATION_TEST(v4color v4color.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(v4coloru v4coloru.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(v4math v4math.cpp "${test_libs}") LL_ADD_INTEGRATION_TEST(v4math v4math.cpp "${test_libs}")
LL_ADD_INTEGRATION_TEST(xform xform.cpp "${test_libs}") LL_ADD_INTEGRATION_TEST(xform xform.cpp "${test_libs}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment