Skip to content
Snippets Groups Projects
Select Git revision
  • a3012bd2a420705736598b1e8dfe9f846525e549
  • master default
  • include-tests
  • remove-yaml-quotes
  • configurable-ci-setup-lookup-path
  • dev-image-test-bak
  • dev-images
  • tmp/deploy-image-build
  • fast-ci
  • modular-templates
10 results

roslaunch_test_generator.sh

Blame
  • Forked from tecnalia_robotics-public / templates
    Source project has a limited visibility.
    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