Move test_utils from tracetools to tracetools_test

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
Christophe Bedard 2020-03-08 23:17:57 -04:00
parent ae9dd2431b
commit c086d8b843
5 changed files with 9 additions and 14 deletions

View file

@ -125,19 +125,8 @@ endif()
if(BUILD_TESTING)
set(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS ${LTTNG_INCLUDE_DIRS})
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
# Only build tracetools utils tests if LTTng is enabled and found
if(TRACETOOLS_LTTNG_ENABLED)
ament_add_gtest(test_utils test/test_utils.cpp)
if(TARGET test_utils)
# Since we cannot use ament_target_dependencies(... tracetools) in the same file
target_link_libraries(test_utils ${PROJECT_NAME} -rdynamic)
endif()
endif()
endif()
ament_package()

View file

@ -13,7 +13,6 @@
<buildtool_depend>ament_cmake_ros</buildtool_depend>
<buildtool_depend>pkg-config</buildtool_depend>
<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

View file

@ -103,8 +103,15 @@ if(BUILD_TESTING)
# Only build tracing tests if LTTng is enabled and found
if(TRACING_ENABLED)
find_package(ament_cmake_pytest REQUIRED)
find_package(ament_cmake_gtest REQUIRED)
ament_add_gtest(test_utils test/test_utils.cpp)
if(TARGET test_utils)
ament_target_dependencies(test_utils
tracetools
)
endif()
find_package(ament_cmake_pytest REQUIRED)
# Run each test in its own pytest invocation
set(_tracetools_test_pytest_tests
test/test_intra.py
@ -114,7 +121,6 @@ if(BUILD_TESTING)
test/test_subscription.py
test/test_timer.py
)
foreach(_test_path ${_tracetools_test_pytest_tests})
get_filename_component(_test_name ${_test_path} NAME_WE)
ament_add_pytest_test(${_test_name} ${_test_path}

View file

@ -20,6 +20,7 @@
<exec_depend>std_msgs</exec_depend>
<exec_depend>std_srvs</exec_depend>
<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_mypy</test_depend>
<test_depend>ament_cmake_pytest</test_depend>
<test_depend>ament_lint_auto</test_depend>