Skip to content
Snippets Groups Projects
Select Git revision
  • 2fe3924c206ed527ae0db7f7dd3086c742b5df1b
  • master default
  • rtde
  • tmp-gpg-key-workaround-2
  • tmp-gpg-key-workaround
  • 68-git-lfs-error-in-ddeploy-job
  • split-build-and-test
  • 66-jazzy-support
  • 62-deploy-jobs-do-not-pull-files-from-lfs-manual-lfs-pull
  • 62-deploy-jobs-do-not-pull-files-from-lfs-custom-docker-image
  • py3-without-industrial-ci-test
  • 58-add-yolo-pip-package-support
  • 55-collision-between-test-jobs-due-to-dds-autodiscovery-ros2
  • 52-ddeploy-job-failing-when-enforcing-labels-alt-quick-dind-test
  • 48-python3_syntax
  • 46-default-docker-image-name-too-long
  • 45-double-pipeline-triggered-if-merge-request-has-melodic-branch-name
  • 40-repo-is-ros-testing
  • test-badges
  • test-lfs-concept
  • add-packages
21 results

roslaunch_test_generator.sh

Blame
  • roslaunch_test_generator.sh 1.09 KiB
    #!/usr/bin/env bash
    
    # shellcheck disable=SC2044
    for foo in $(find "$(pwd)" -name "package.xml") ; do
      package_name=$(basename "$(realpath "$(dirname "$foo")")")
      echo Entering package: "$package_name"
      cd "$(realpath "$(dirname "$foo")")" || exit
      if grep -q -i "roslaunch_add_file_check" CMakeLists.txt; then
        echo Package "$package_name" already has roslaunch_add_file_check - skipping
      else
        if [[ -n $(find . -type f -name "*.launch") ]] ; then
          echo Adding roslaunch_add_file_check to "$package_name"
    cat <<EOT >> CMakeLists.txt
    
    ## WARNING: automatically generated code; can be (and probably is) very buggy
    if(CATKIN_ENABLE_TESTING)
    find_package(catkin REQUIRED COMPONENTS
    roslaunch
    )
    EOT
    
    ## The roslaunch_add_file_check macro supports as parameter either a folder or a single launchfile
    ## Here we call the macro for each of the launchfiles in the package
      for launchfile in $(find . -type f -name "*.launch") ; do
    cat <<EOT >> CMakeLists.txt
    roslaunch_add_file_check(${launchfile})
    EOT
      done
    
    ## Close if(CATKIN_ENABLE_TESTING)
    cat <<EOT >> CMakeLists.txt
    endif()
    EOT
    
        fi
      fi
    done