[ros-rospack] 01/02: Fix unit tests

Jochen Sprickerhof jspricke-guest at moszumanska.debian.org
Tue Jul 26 16:31:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

jspricke-guest pushed a commit to branch master
in repository ros-rospack.

commit 3bdfb5fb904e74d8c85d0413f81a8be080f8ef64
Author: Jochen Sprickerhof <git at jochen.sprickerhof.de>
Date:   Tue Jul 26 17:35:38 2016 +0200

    Fix unit tests
---
 debian/control                           |  3 +-
 debian/patches/0006-Fix-unit-tests.patch | 93 ++++++++++++++++++++++++++++++++
 debian/patches/series                    |  1 +
 debian/rules                             |  4 +-
 4 files changed, 98 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 15a1d91..6db833c 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,8 @@ Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.
 Uploaders: Thomas Moulard <thomas.moulard at gmail.com>,
            Jochen Sprickerhof <debian at jochen.sprickerhof.de>,
            Leopold Palomo-Avellaneda <leo at alaxarxa.net>
-Build-Depends: debhelper (>= 9), catkin (>> 0.6.16-2), libboost-filesystem-dev, libboost-program-options-dev, libboost-system-dev, libpython-dev, libtinyxml-dev, libgtest-dev, ros-cmake-modules
+# roslang is only needed for the unit tests
+Build-Depends: debhelper (>= 9), catkin (>> 0.6.16-2), libboost-filesystem-dev, libboost-program-options-dev, libboost-system-dev, libpython-dev, libtinyxml-dev, libgtest-dev, ros-cmake-modules, roslang
 Standards-Version: 3.9.8
 Section: libs
 Homepage: https://github.com/ros/rospack
diff --git a/debian/patches/0006-Fix-unit-tests.patch b/debian/patches/0006-Fix-unit-tests.patch
new file mode 100644
index 0000000..b46d554
--- /dev/null
+++ b/debian/patches/0006-Fix-unit-tests.patch
@@ -0,0 +1,93 @@
+From: Jochen Sprickerhof <git at jochen.sprickerhof.de>
+Date: Tue, 26 Jul 2016 17:35:53 +0200
+Subject: Fix unit tests
+
+Different to OSRF we have catkin, cmake_modules and roslang installed in
+our ROS workspace.
+---
+ test/test/utest.cpp | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/test/test/utest.cpp b/test/test/utest.cpp
+index 76b64a7..3f79357 100644
+--- a/test/test/utest.cpp
++++ b/test/test/utest.cpp
+@@ -57,13 +57,13 @@ TEST(rospack, reentrant)
+   output = rp.getOutput();
+   boost::trim(output);
+   boost::split(output_list, output, boost::is_any_of("\n"));
+-  ASSERT_EQ((int)output_list.size(), 4);
++  ASSERT_EQ((int)output_list.size(), 6);
+   ret = rp.run(std::string("list"));
+   ASSERT_EQ(ret, 0);
+   output = rp.getOutput();
+   boost::trim(output);
+   boost::split(output_list, output, boost::is_any_of("\n"));
+-  ASSERT_EQ((int)output_list.size(), 4);
++  ASSERT_EQ((int)output_list.size(), 6);
+   std::vector<std::string> path_name;
+   boost::split(path_name, output_list[0], boost::is_any_of(" "));
+   ASSERT_EQ((int)path_name.size(), 2);
+@@ -83,13 +83,13 @@ TEST(rospack, multiple_rospack_objects)
+   output = rp.getOutput();
+   boost::trim(output);
+   boost::split(output_list, output, boost::is_any_of("\n"));
+-  ASSERT_EQ((int)output_list.size(), 4);
++  ASSERT_EQ((int)output_list.size(), 6);
+   ret = rp.run(std::string("list"));
+   ASSERT_EQ(ret, 0);
+   output = rp.getOutput();
+   boost::trim(output);
+   boost::split(output_list, output, boost::is_any_of("\n"));
+-  ASSERT_EQ((int)output_list.size(), 4);
++  ASSERT_EQ((int)output_list.size(), 6);
+   std::vector<std::string> path_name;
+   boost::split(path_name, output_list[0], boost::is_any_of(" "));
+   ASSERT_EQ((int)path_name.size(), 2);
+@@ -105,13 +105,13 @@ TEST(rospack, multiple_rospack_objects)
+   output = rp2.getOutput();
+   boost::trim(output);
+   boost::split(output_list, output, boost::is_any_of("\n"));
+-  ASSERT_EQ((int)output_list.size(), 4);
++  ASSERT_EQ((int)output_list.size(), 6);
+   ret = rp2.run(std::string("list"));
+   ASSERT_EQ(ret, 0);
+   output = rp2.getOutput();
+   boost::trim(output);
+   boost::split(output_list, output, boost::is_any_of("\n"));
+-  ASSERT_EQ((int)output_list.size(), 4);
++  ASSERT_EQ((int)output_list.size(), 6);
+   path_name.clear();
+   boost::split(path_name, output_list[0], boost::is_any_of(" "));
+   ASSERT_EQ((int)path_name.size(), 2);
+@@ -138,6 +138,8 @@ TEST(rospack, env_change)
+   std::string rr = std::string(getcwd(buf, sizeof(buf))) + "/test2";
+   setenv("ROS_PACKAGE_PATH", rr.c_str(), 1);
+   std::vector<std::string> test_pkgs;
++  test_pkgs.push_back("catkin");
++  test_pkgs.push_back("cmake_modules");
+   test_pkgs.push_back("precedence1");
+   test_pkgs.push_back("precedence2");
+   test_pkgs.push_back("precedence3");
+@@ -174,9 +176,12 @@ TEST(rospack, env_change)
+   rr = std::string(getcwd(buf, sizeof(buf))) + "/test3";
+   setenv("ROS_PACKAGE_PATH", rr.c_str(), 1);
+   test_pkgs.clear();
++  test_pkgs.push_back("catkin");
++  test_pkgs.push_back("cmake_modules");
+   test_pkgs.push_back("precedence1");
+   test_pkgs.push_back("precedence2");
+   test_pkgs.push_back("precedence3");
++  test_pkgs.push_back("roslang");
+   ret = rp.run(std::string("list-names"));
+   EXPECT_EQ(ret, 0);
+   output_list.clear();
+@@ -211,7 +216,7 @@ TEST(rospack, env_change)
+   EXPECT_EQ(ret, 0);
+   output = rp.getOutput();
+   boost::trim(output);
+-  EXPECT_EQ(output, std::string());
++  EXPECT_EQ(output, "catkin\ncmake_modules\nroslang");
+ 
+   // Reset old path, for other tests
+   setenv("ROS_PACKAGE_PATH", oldrpp, 1);
diff --git a/debian/patches/series b/debian/patches/series
index 80ffc73..21ed6cd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 0003-Make-rospack-usable-without-rosdep.patch
 0004-Limit-search-depth-for-usr-share.patch
 0005-Fix-FTBFS-on-hurd-i386.patch
+0006-Fix-unit-tests.patch
diff --git a/debian/rules b/debian/rules
index 5ae46d0..0f5d9cf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,10 +2,10 @@
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/default.mk
 %:
-	dh $@ 
+	dh $@ --builddirectory=build
 
-# test suite is broken atm.
 override_dh_auto_test:
+	make -C build run_tests
 
 get-orig-source:
 	uscan --verbose --force-download --repack --compress xz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ros/ros-rospack.git



More information about the debian-science-commits mailing list