Commit 23435776 authored by Max Lyon's avatar Max Lyon

add unittests for default double vec type

parent a15f247a
Pipeline #12506 passed with stage
in 85 minutes and 19 seconds
......@@ -119,6 +119,8 @@ unittests.exe --gtest_output=xml
unittests_customvec.exe --gtest_output=xml
unittests_doublevec.exe --gtest_output=xml
cd ..
cd ..
......@@ -147,6 +149,8 @@ unittests.exe --gtest_output=xml
unittests_customvec.exe --gtest_output=xml
unittests_doublevec.exe --gtest_output=xml
IF %errorlevel% NEQ 0 exit /b %errorlevel%
cd ..
......
......@@ -87,6 +87,8 @@ make $MAKE_OPTIONS
#build the unit tests
make $MAKE_OPTIONS unittests
cd Unittests
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
......@@ -94,8 +96,6 @@ echo "Running unittests Release version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
......@@ -106,8 +106,19 @@ echo "Running unittests Release version with custom vector type"
echo "======================================================================"
echo -e "${NC}"
#execute tests
./unittests_customvec --gtest_color=yes --gtest_output=xml
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Release version with double vector type"
echo "======================================================================"
echo -e "${NC}"
#execute tests
./unittests_doublevec --gtest_color=yes --gtest_output=xml
cd ..
cd ..
......@@ -133,6 +144,8 @@ make $MAKE_OPTIONS
#build the unit tests
make $MAKE_OPTIONS unittests
cd Unittests
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
......@@ -140,9 +153,6 @@ echo "Running unittests Debug version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
......@@ -153,7 +163,18 @@ echo "Running unittests Debug version with custom vector type"
echo "======================================================================"
echo -e "${NC}"
#execute tests
./unittests_customvec --gtest_color=yes --gtest_output=xml
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Debug version with double vector type"
echo "======================================================================"
echo -e "${NC}"
#execute tests
./unittests_doublevec --gtest_color=yes --gtest_output=xml
cd ..
cd ..
......@@ -69,6 +69,8 @@ make
#build the unit tests
make unittests
cd Unittests
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
......@@ -76,8 +78,6 @@ echo "Running unittests Release version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
......@@ -88,8 +88,19 @@ echo "Running unittests Release version with minimal vector type"
echo "======================================================================"
echo -e "${NC}"
#execute tests
./unittests_customvec --gtest_color=yes --gtest_output=xml
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Release version with double vector type"
echo "======================================================================"
echo -e "${NC}"
#execute tests
./unittests_doublevec --gtest_color=yes --gtest_output=xml
cd ..
cd ..
......@@ -115,6 +126,8 @@ make
#build the unit tests
make unittests
cd Unittests
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
......@@ -122,9 +135,6 @@ echo "Running unittests Debug version with vectorchecks enabled"
echo "======================================================================"
echo -e "${NC}"
cd Unittests
#execute tests
./unittests --gtest_color=yes --gtest_output=xml
......@@ -135,8 +145,19 @@ echo "Running unittests Debug version with minimal vector type"
echo "======================================================================"
echo -e "${NC}"
#execute tests
./unittests_customvec --gtest_color=yes --gtest_output=xml
echo -e "${OUTPUT}"
echo ""
echo "======================================================================"
echo "Running unittests Debug version with double vector type"
echo "======================================================================"
echo -e "${NC}"
#execute tests
./unittests_doublevec --gtest_color=yes --gtest_output=xml
cd ..
cd ..
......
......@@ -41,20 +41,25 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
# Create unittest executable
acg_add_executable(unittests ${UNITTEST_SRC})
acg_add_executable(unittests_customvec ${UNITTEST_SRC})
acg_add_executable(unittests_doublevec ${UNITTEST_SRC})
target_compile_definitions(unittests_customvec PRIVATE TEST_CUSTOM_TRAITS)
target_compile_definitions(unittests_doublevec PRIVATE TEST_DOUBLE_TRAITS)
# For the unittest we don't want the install rpath as set by acg_add_executable
set_target_properties ( unittests PROPERTIES BUILD_WITH_INSTALL_RPATH 0 )
set_target_properties ( unittests PROPERTIES BUILD_WITH_INSTALL_RPATH 0 )
set_target_properties ( unittests_customvec PROPERTIES BUILD_WITH_INSTALL_RPATH 0 )
set_target_properties ( unittests_doublevec PROPERTIES BUILD_WITH_INSTALL_RPATH 0 )
# Set output directory to ${BINARY_DIR}/Unittests
set (OUTPUT_DIR "${CMAKE_BINARY_DIR}/Unittests")
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
set_target_properties(unittests_customvec PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
set_target_properties(unittests_doublevec PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${CONFIG} UPCONFIG)
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${UPCONFIG} ${OUTPUT_DIR})
set_target_properties(unittests_customvec PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${UPCONFIG} ${OUTPUT_DIR})
set_target_properties(unittests_doublevec PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${UPCONFIG} ${OUTPUT_DIR})
endforeach()
......@@ -62,6 +67,7 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
# Link against all necessary libraries
target_link_libraries(unittests OpenMeshCore OpenMeshTools ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
target_link_libraries(unittests_customvec OpenMeshCore OpenMeshTools ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
target_link_libraries(unittests_doublevec OpenMeshCore OpenMeshTools ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
......@@ -71,8 +77,9 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
add_definitions( -DOPENMESHDLL )
endif()
target_link_libraries(unittests OpenMeshCore OpenMeshTools ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
target_link_libraries(unittests OpenMeshCore OpenMeshTools ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
target_link_libraries(unittests_customvec OpenMeshCore OpenMeshTools ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
target_link_libraries(unittests_doublevec OpenMeshCore OpenMeshTools ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
endif()
......@@ -81,10 +88,12 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
# Set compiler flags
set_target_properties(unittests PROPERTIES COMPILE_FLAGS "-g -pedantic -Wno-long-long")
set_target_properties(unittests_customvec PROPERTIES COMPILE_FLAGS "-g -pedantic -Wno-long-long")
set_target_properties(unittests_doublevec PROPERTIES COMPILE_FLAGS "-g -pedantic -Wno-long-long")
else()
# Set compiler flags
set_target_properties(unittests PROPERTIES COMPILE_FLAGS "" )
set_target_properties(unittests_customvec PROPERTIES COMPILE_FLAGS "" )
set_target_properties(unittests_doublevec PROPERTIES COMPILE_FLAGS "" )
endif()
if ( OPENMESH_BUILD_SHARED )
......@@ -103,14 +112,21 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
"$<TARGET_FILE:${TAR}>"
"${CMAKE_BINARY_DIR}/Unittests/$<TARGET_FILE_NAME:${TAR}>"
COMMENT "Copying OpenMesh targets to unittests directory")
add_custom_command(TARGET unittests_doublevec POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:${TAR}>"
"${CMAKE_BINARY_DIR}/Unittests/$<TARGET_FILE_NAME:${TAR}>"
COMMENT "Copying OpenMesh targets to unittests directory")
endforeach(TAR)
endif()
acg_copy_after_build(unittests ${CMAKE_CURRENT_SOURCE_DIR}/TestFiles ${CMAKE_BINARY_DIR}/Unittests/)
acg_copy_after_build(unittests_customvec ${CMAKE_CURRENT_SOURCE_DIR}/TestFiles ${CMAKE_BINARY_DIR}/Unittests/)
acg_copy_after_build(unittests_doublevec ${CMAKE_CURRENT_SOURCE_DIR}/TestFiles ${CMAKE_BINARY_DIR}/Unittests/)
add_test(NAME AllTestsIn_OpenMesh_tests WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Unittests" COMMAND "${CMAKE_BINARY_DIR}/Unittests/unittests")
add_test(NAME AllTestsIn_OpenMesh_tests_with_minimal_vector WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Unittests" COMMAND "${CMAKE_BINARY_DIR}/Unittests/unittests_customvec")
add_test(NAME AllTestsIn_OpenMesh_tests_with_double_vector WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Unittests" COMMAND "${CMAKE_BINARY_DIR}/Unittests/unittests_doublevec")
else(GTEST_FOUND)
message(STATUS "Google testing framework was not found, unittests disabled.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment