Convert monolithic RecompileCompare and WriteReadCompare tests into test suites, one test per file.
PiperOrigin-RevId: 890149850 Change-Id: Ib3e8c032a7b43b4a3f85e7a922e25987050cd77c
This commit is contained in:
committed by
Copybara-Service
parent
0021564035
commit
9f5fc99711
+30
-13
@@ -54,20 +54,36 @@ macro(mujoco_test name)
|
||||
endif()
|
||||
target_include_directories(${name} PRIVATE ${MUJOCO_TEST_INCLUDE})
|
||||
set_target_properties(${name} PROPERTIES BUILD_RPATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
# gtest_discover_tests is recommended over gtest_add_tests, but has some issues in Windows.
|
||||
gtest_add_tests(
|
||||
TARGET ${name}
|
||||
SOURCES ${name}.cc
|
||||
WORKING_DIRECTORY ${MUJOCO_TEST_WORKING_DIR}
|
||||
TEST_LIST testList
|
||||
)
|
||||
if(WIN32)
|
||||
set_tests_properties(
|
||||
${testList} PROPERTIES ENVIRONMENT "PATH=$<TARGET_FILE_DIR:mujoco>;$ENV{PATH}"
|
||||
# gtest_discover_tests is recommended over gtest_add_tests, but has issues on Windows.
|
||||
# It also requires a GoogleTest binary, so we fall back for custom MAIN_TARGET (e.g. benchmarks).
|
||||
if(WIN32 OR _ARGS_MAIN_TARGET)
|
||||
gtest_add_tests(
|
||||
TARGET ${name}
|
||||
SOURCES ${name}.cc
|
||||
WORKING_DIRECTORY ${MUJOCO_TEST_WORKING_DIR}
|
||||
TEST_LIST testList
|
||||
)
|
||||
endif()
|
||||
if(_ARGS_PROPERTIES)
|
||||
set_tests_properties(${testList} PROPERTIES ${_ARGS_PROPERTIES})
|
||||
if(WIN32)
|
||||
set_tests_properties(
|
||||
${testList} PROPERTIES ENVIRONMENT "PATH=$<TARGET_FILE_DIR:mujoco>;$ENV{PATH}"
|
||||
)
|
||||
endif()
|
||||
if(_ARGS_PROPERTIES)
|
||||
set_tests_properties(${testList} PROPERTIES ${_ARGS_PROPERTIES})
|
||||
endif()
|
||||
else()
|
||||
if(_ARGS_PROPERTIES)
|
||||
gtest_discover_tests(
|
||||
${name}
|
||||
WORKING_DIRECTORY ${MUJOCO_TEST_WORKING_DIR}
|
||||
PROPERTIES ${_ARGS_PROPERTIES}
|
||||
)
|
||||
else()
|
||||
gtest_discover_tests(
|
||||
${name}
|
||||
WORKING_DIRECTORY ${MUJOCO_TEST_WORKING_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
@@ -102,3 +118,4 @@ add_subdirectory(xml)
|
||||
add_subdirectory(plugin/elasticity)
|
||||
add_subdirectory(plugin/actuator)
|
||||
add_subdirectory(experimental)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user