commit:     0a78462172aaeeb01af14d2043d83fe0dc7f9e0e
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 11 16:11:36 2019 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Wed Dec 11 16:12:29 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a784621

dev-ros/navfn: fix tests

Closes: https://bugs.gentoo.org/625168
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 dev-ros/navfn/files/tests.patch   | 13 +++++++++++++
 dev-ros/navfn/navfn-1.16.3.ebuild |  7 ++++++-
 dev-ros/navfn/navfn-9999.ebuild   |  9 +++++++--
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/dev-ros/navfn/files/tests.patch b/dev-ros/navfn/files/tests.patch
new file mode 100644
index 00000000000..2dcd222f608
--- /dev/null
+++ b/dev-ros/navfn/files/tests.patch
@@ -0,0 +1,13 @@
+Index: navfn/test/path_calc_test.cpp
+===================================================================
+--- navfn.orig/test/path_calc_test.cpp
++++ navfn/test/path_calc_test.cpp
+@@ -38,7 +38,7 @@
+ navfn::NavFn* make_willow_nav()
+ {
+   int sx,sy;
+-  std::string path = ros::package::getPath( ROS_PACKAGE_NAME ) + 
"/test/willow_costmap.pgm";
++  std::string path = @PGM_PATH@ ;
+ 
+   COSTTYPE *cmap = readPGM( path.c_str(), &sx, &sy, true );
+   if( cmap == NULL )

diff --git a/dev-ros/navfn/navfn-1.16.3.ebuild 
b/dev-ros/navfn/navfn-1.16.3.ebuild
index da142f226c8..a65e0eb3f75 100644
--- a/dev-ros/navfn/navfn-1.16.3.ebuild
+++ b/dev-ros/navfn/navfn-1.16.3.ebuild
@@ -36,4 +36,9 @@ DEPEND="${RDEPEND}
        test? ( dev-cpp/gtest )
        dev-ros/cmake_modules"
 
-PATCHES=( "${FILESDIR}/pgm_h_location.patch" )
+PATCHES=( "${FILESDIR}/pgm_h_location.patch" "${FILESDIR}/tests.patch" )
+
+src_prepare() {
+       ros-catkin_src_prepare
+       sed -e "s#@PGM_PATH@#\"${S}/test/willow_costmap.pgm\"#" -i 
test/path_calc_test.cpp || die
+}

diff --git a/dev-ros/navfn/navfn-9999.ebuild b/dev-ros/navfn/navfn-9999.ebuild
index da9427d6977..a65e0eb3f75 100644
--- a/dev-ros/navfn/navfn-9999.ebuild
+++ b/dev-ros/navfn/navfn-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -36,4 +36,9 @@ DEPEND="${RDEPEND}
        test? ( dev-cpp/gtest )
        dev-ros/cmake_modules"
 
-PATCHES=( "${FILESDIR}/pgm_h_location.patch" )
+PATCHES=( "${FILESDIR}/pgm_h_location.patch" "${FILESDIR}/tests.patch" )
+
+src_prepare() {
+       ros-catkin_src_prepare
+       sed -e "s#@PGM_PATH@#\"${S}/test/willow_costmap.pgm\"#" -i 
test/path_calc_test.cpp || die
+}

Reply via email to