From 08b334f9b0a29bbb8112fde032aff0cc58daca43 Mon Sep 17 00:00:00 2001 From: Alexander Sherikov Date: Sat, 21 Dec 2024 23:40:33 +0400 Subject: [PATCH] Sync and update ROS1 and ROS2 tests --- ccws/tests/test_main.mk | 91 +++++++++++++++++++----------------- ccws/tests/test_main_ros2.mk | 78 ++++++++++++++++++++----------- 2 files changed, 99 insertions(+), 70 deletions(-) diff --git a/ccws/tests/test_main.mk b/ccws/tests/test_main.mk index 381deff..9683520 100644 --- a/ccws/tests/test_main.mk +++ b/ccws/tests/test_main.mk @@ -17,36 +17,9 @@ test: ${MAKE} dep_install PKG=test_pkg ${MAKE} test_pkg BUILD_PROFILE=test_profile # --- - # reset - ${MAKE} bp_purge - ${MAKE} wspurge - ${MAKE} wsinit REPOS="https://github.com/asherikov/staticoma.git" - # --- - # add dependencies to the workspace and build deb package - ${MAKE} dep_to_repolist PKG=staticoma - ${MAKE} dep_to_repolist - ${MAKE} wsupdate - ${MAKE} dep_install PKG=staticoma - ${MAKE} dep_install - ${MAKE} bp_install_build BUILD_PROFILE=deb - ${MAKE} staticoma BUILD_PROFILE=deb BASE_BUILD_PROFILE=reldebug - ${MAKE} deb_lint PKG=staticoma BUILD_PROFILE=deb BASE_BUILD_PROFILE=reldebug - sudo dpkg -i artifacts/*/*.deb - dpkg --get-selections | grep staticoma | cut -f 1 | xargs sudo apt purge --yes - # --- - # drop downloaded ROS packages, we are going to install binaries - ${MAKE} wsclean - mv "${WORKSPACE_SRC}/staticoma" ./ - rm -Rf "${WORKSPACE_SRC}"/* - mv staticoma "${WORKSPACE_SRC}" - ${MAKE} dep_install PKG=staticoma - # --- - # workspace cmake toolchain - mkdir -p "${WORKSPACE_SRC}/.ccws/" - echo 'message(FATAL_ERROR "toolchain inclusion")' > "${WORKSPACE_SRC}/.ccws/toolchain.cmake" - # should fail - ! ${MAKE} staticoma - rm -Rf "${WORKSPACE_SRC}/.ccws" + ${MAKE} -f ${THIS_MAKEFILE} test_dependencies + ${MAKE} -f ${THIS_MAKEFILE} test_deb + ${MAKE} -f ${THIS_MAKEFILE} test_cmake_toolchain # --- # test various build profiles ${MAKE} -f ${THIS_MAKEFILE} build_with_profile BUILD_PROFILE=addr_undef_sanitizers @@ -58,12 +31,6 @@ test: ${MAKE} bp_install_build BUILD_PROFILE=clangd ${MAKE} BUILD_PROFILE=clangd BASE_BUILD_PROFILE=reldebug # --- - # cppcheck - cp -R ccws/examples/.ccws "${WORKSPACE_SRC}" - ${MAKE} bp_install_build BUILD_PROFILE=cppcheck - ${MAKE} BUILD_PROFILE=cppcheck BASE_BUILD_PROFILE=reldebug - rm -Rf "${WORKSPACE_SRC}/.ccws" - # --- # check valgrind exec profile ${MAKE} ep_install EXEC_PROFILE=valgrind ${MAKE} wstest EXEC_PROFILE=valgrind @@ -72,6 +39,21 @@ test: ${MAKE} ep_install EXEC_PROFILE=core_pattern ${MAKE} wstest EXEC_PROFILE="core_pattern valgrind" # --- + # documentation + ${MAKE} bp_install_build BUILD_PROFILE=doxygen + ${MAKE} PKG=staticoma BUILD_PROFILE=doxygen + ${MAKE} BUILD_PROFILE=doxygen + ${MAKE} graph PKG=staticoma + ${MAKE} graph + ${MAKE} cache_clean + ${MAKE} wsclean + # --- + # cppcheck + cp -R ccws/examples/.ccws "${WORKSPACE_SRC}" + ${MAKE} bp_install_build BUILD_PROFILE=cppcheck + ${MAKE} BUILD_PROFILE=cppcheck BASE_BUILD_PROFILE=reldebug + rm -Rf "${WORKSPACE_SRC}/.ccws" + # --- # static checks ${MAKE} bp_install_build BUILD_PROFILE=static_checks # must fail without exceptions @@ -82,15 +64,38 @@ test: # must succeed without package exceptions rm "${WORKSPACE_SRC}/.ccws/static_checks.exceptions.packages" ${MAKE} BUILD_PROFILE=static_checks + +test_dependencies: + # reset + ${MAKE} bp_purge + ${MAKE} wspurge + ${MAKE} wsinit REPOS="https://github.com/asherikov/staticoma.git" # --- - # documentation - ${MAKE} bp_install_build BUILD_PROFILE=doxygen - ${MAKE} PKG=staticoma BUILD_PROFILE=doxygen - ${MAKE} BUILD_PROFILE=doxygen - ${MAKE} graph PKG=staticoma - ${MAKE} graph - ${MAKE} cache_clean + # add dependencies to the workspace and build deb package + ${MAKE} dep_to_repolist + ${MAKE} wsupdate + ${MAKE} dep_install + +test_deb: + ${MAKE} bp_install_build BUILD_PROFILE=deb + ${MAKE} staticoma BUILD_PROFILE=deb BASE_BUILD_PROFILE=reldebug + ${MAKE} deb_lint PKG=staticoma BUILD_PROFILE=deb BASE_BUILD_PROFILE=reldebug + sudo dpkg -i artifacts/*/*.deb + dpkg --get-selections | grep staticoma | cut -f 1 | xargs sudo apt purge --yes + # --- + # drop downloaded ROS packages, we are going to install binaries ${MAKE} wsclean + mv "${WORKSPACE_SRC}/staticoma" ./ + rm -Rf "${WORKSPACE_SRC}"/* + mv staticoma "${WORKSPACE_SRC}" + +test_cmake_toolchain: + # workspace cmake toolchain + cp -R ccws/examples/.ccws "${WORKSPACE_SRC}/" + echo 'message(FATAL_ERROR "toolchain inclusion")' > "${WORKSPACE_SRC}/.ccws/toolchain.cmake" + # should fail + ! ${MAKE} examples_rclcpp_minimal_subscriber + rm -Rf "${WORKSPACE_SRC}/.ccws" build_with_profile: ${MAKE} wsclean diff --git a/ccws/tests/test_main_ros2.mk b/ccws/tests/test_main_ros2.mk index 328054c..943c891 100644 --- a/ccws/tests/test_main_ros2.mk +++ b/ccws/tests/test_main_ros2.mk @@ -14,29 +14,15 @@ test: ${MAKE} wsinit ${MAKE} new PKG=test_pkg EMAIL=example@example.org AUTHOR=example ${MAKE} wsscrape_all - #${MAKE} dep_to_repolist PKG=test_pkg + ${MAKE} dep_to_repolist PKG=test_pkg ${MAKE} wsupdate ${MAKE} log_output TARGET=wsstatus - #${MAKE} dep_install PKG=test_pkg - #${MAKE} test_pkg BUILD_PROFILE=test_profile + ${MAKE} dep_install PKG=test_pkg + ${MAKE} test_pkg BUILD_PROFILE=test_profile # --- - # dependencies ${MAKE} -f ${THIS_MAKEFILE} test_dependencies - # --- - # workspace cmake toolchain - cp -R ccws/examples/.ccws "${WORKSPACE_SRC}/" - echo 'message(FATAL_ERROR "toolchain inclusion")' > "${WORKSPACE_SRC}/.ccws/toolchain.cmake" - # should fail - ! ${MAKE} examples_rclcpp_minimal_subscriber - rm -Rf "${WORKSPACE_SRC}/.ccws" - # --- - # static checks - ${MAKE} bp_install_build BUILD_PROFILE=static_checks - # --- - # deb - ${MAKE} bp_install_build BUILD_PROFILE=deb - ${MAKE} examples_rclcpp_minimal_subscriber BUILD_PROFILE=deb BASE_BUILD_PROFILE=reldebug - ${MAKE} deb_lint PKG=examples_rclcpp_minimal_subscriber BUILD_PROFILE=deb BASE_BUILD_PROFILE=reldebug + ${MAKE} -f ${THIS_MAKEFILE} test_deb + ${MAKE} -f ${THIS_MAKEFILE} test_cmake_toolchain # --- # test various build profiles sudo apt install ros-${ROS_DISTRO}-ros2cli # used to test setup.bash @@ -45,6 +31,10 @@ test: ${MAKE} -f ${THIS_MAKEFILE} build_with_profile BUILD_PROFILE=scan_build ${MAKE} -f ${THIS_MAKEFILE} build_with_profile BUILD_PROFILE=reldebug # --- + # clangd + ${MAKE} bp_install_build BUILD_PROFILE=clangd + ${MAKE} BUILD_PROFILE=clangd BASE_BUILD_PROFILE=reldebug + # --- # check valgrind exec profile ${MAKE} ep_install EXEC_PROFILE=valgrind ${MAKE} wstest EXEC_PROFILE=valgrind @@ -53,34 +43,68 @@ test: ${MAKE} ep_install EXEC_PROFILE=core_pattern ${MAKE} wstest EXEC_PROFILE="core_pattern valgrind" # --- - # clangd - ${MAKE} bp_install_build BUILD_PROFILE=clangd - ${MAKE} BUILD_PROFILE=clangd BASE_BUILD_PROFILE=reldebug - # --- # documentation ${MAKE} bp_install_build BUILD_PROFILE=doxygen + ${MAKE} PKG=examples_rclcpp_minimal_subscriber BUILD_PROFILE=doxygen ${MAKE} BUILD_PROFILE=doxygen ${MAKE} graph PKG=examples_rclcpp_minimal_subscriber ${MAKE} graph ${MAKE} cache_clean - test -z "${WORKSPACE_SRC}" || (test -d "${WORKSPACE_SRC}" && ls "${WORKSPACE_SRC}") + ${MAKE} wsclean + # --- + ${MAKE} wspurge + ${MAKE} wsinit + ${MAKE} add REPO="https://github.com/asherikov/ariles.git" VERSION="pkg_ws_2" + ${MAKE} build_all + # --- + # cppcheck + cp -R ccws/examples/.ccws "${WORKSPACE_SRC}" + ${MAKE} bp_install_build BUILD_PROFILE=cppcheck + ${MAKE} BUILD_PROFILE=cppcheck BASE_BUILD_PROFILE=reldebug + rm -Rf "${WORKSPACE_SRC}/.ccws" + # --- + # static checks + ${MAKE} bp_install_build BUILD_PROFILE=static_checks + ${MAKE} BUILD_PROFILE=static_checks test_dependencies: ${MAKE} bp_purge ${MAKE} wspurge - ${MAKE} bp_install_build ${MAKE} new PKG=test_dependencies cp -R ccws/tests/dependencies/package.xml "${WORKSPACE_SRC}/test_dependencies" ${MAKE} dep_install PKG=test_dependencies ${MAKE} wspurge ${MAKE} add REPO="https://github.com/ros2/examples" VERSION="${ROS_DISTRO}" ${MAKE} wsupdate - ${MAKE} dep_install PKG=examples_rclcpp_minimal_subscriber + ${MAKE} dep_to_repolist + ${MAKE} dep_install + ${MAKE} wsupdate + # --- + # drop downloaded ROS packages, we are going to install binaries + ${MAKE} wsclean + mv "${WORKSPACE_SRC}/examples" ./ + rm -Rf "${WORKSPACE_SRC}"/* + mv examples "${WORKSPACE_SRC}" + +test_deb: + ${MAKE} bp_install_build BUILD_PROFILE=deb + ${MAKE} examples_rclcpp_minimal_subscriber BUILD_PROFILE=deb BASE_BUILD_PROFILE=reldebug + ${MAKE} deb_lint PKG=examples_rclcpp_minimal_subscriber BUILD_PROFILE=deb BASE_BUILD_PROFILE=reldebug + sudo dpkg -i artifacts/*/*.deb + dpkg --get-selections | grep minimal-subscriber | cut -f 1 | xargs sudo apt purge --yes + +test_cmake_toolchain: + # workspace cmake toolchain + cp -R ccws/examples/.ccws "${WORKSPACE_SRC}/" + echo 'message(FATAL_ERROR "toolchain inclusion")' > "${WORKSPACE_SRC}/.ccws/toolchain.cmake" + # should fail + ! ${MAKE} examples_rclcpp_minimal_subscriber + rm -Rf "${WORKSPACE_SRC}/.ccws" build_with_profile: ${MAKE} wsclean ${MAKE} bp_install_build - #${MAKE} build_all + ${MAKE} build_all ${MAKE} examples_rclcpp_minimal_subscriber # workspace test ${MAKE} wstest