From bc7531fe64343fce8067100b9f52e83661c4a234 Mon Sep 17 00:00:00 2001
From: Jon Azpiazu <jon.azpiazu@tecnalia.com>
Date: Fri, 30 Nov 2018 10:19:15 +0100
Subject: [PATCH] Fix the roslaunch_add_file_check bug that produced the
 filename too long problem

---
 scripts/roslaunch_test_generator.sh | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/scripts/roslaunch_test_generator.sh b/scripts/roslaunch_test_generator.sh
index d3771a3..8d8f8f1 100644
--- a/scripts/roslaunch_test_generator.sh
+++ b/scripts/roslaunch_test_generator.sh
@@ -16,11 +16,21 @@ if(CATKIN_ENABLE_TESTING)
 find_package(catkin REQUIRED COMPONENTS
 roslaunch
 )
-roslaunch_add_file_check(
-$(find . -type f -name "*.launch")
-)
+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
-- 
GitLab