Skip to main content

Questions tagged [rostest]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
24 views

ROS node testing (publish/subscribe)

I am struggling with an example integration test for a ROS node (in Python). I have a node that somehow processes input data and outputs some messages based on this: ...
Dmytro Prylipko's user avatar
0 votes
1 answer
40 views

Mocking ros::Time::now in rostest/gtest

I am running the tests for my ROS C++ node using rostest/gtest. Currently I have a problem where I have a class method that I need/want to test that out of date data based on the value of ...
Ricardo Marques's user avatar
0 votes
0 answers
16 views

How has anyone successfully used rostest for automated testing in ROS Melodic and Noetic since 2015?

I'm developing for a system currently based on ROS Melodic, running on Ubuntu 18.04. I'm adding unit testing for a node in C++ and thus registering the test with the ...
McManip's user avatar
0 votes
1 answer
34 views

Mocking call to third-party module from Publisher

I have just started working with ROS2 in python on an existing project and have to write unit tests to begin with. The production code will run on a raspberry pi, but testing is being done in an ...
Nick's user avatar
  • 101
0 votes
1 answer
16 views

Does rostest/gtest (ROS , CPP) provide any conditional compilaton flag?

does rostest/gtest (ROS , CPP) provide any conditional compilaton flag? My use case is that i have a code snippet using std::chrono::steady_clock to wait for many seconds to enter specific parts of ...
ACristea's user avatar
0 votes
0 answers
16 views

How do I use catkin_download_test_data() correctly to run rostests?

I have a working rostest which I was running against a bagfile of image data. Earlier I had stored it in my git package but since its a big file I am thinking of storing the bag file in cloud and ...
nebula's user avatar
  • 1
0 votes
1 answer
39 views

Code coverage with pytest-based ROS tests

Hi, I'm trying to add code coverage to my pytests, following the instructions from code_coverage repo, except that I use python3-coverage. I run my rostest with pytest using the Pytest integration ...
user avatar
0 votes
2 answers
4 views

How to detect launch file validation failure in a script?

Hello, I am trying to setup launch file validation within my repo's CI using roslaunch_add_file_check. My CMakeLists.txt looks ...
user avatar
0 votes
2 answers
1 view

Rostest succeeds test if a node crashes

If a node in a test-case crashed, rostest doesn't care about it, and succeeds the testcase. For example: ...
user avatar
0 votes
1 answer
18 views

Enforce consecutive execution order for gtest and rostest

My ROS package contains two test executables, one gtest and one rostest. They are specified in the CMakeLists as, catkin_add_gtest(...) and ...
user avatar
0 votes
1 answer
55 views

How to run multiple rostests with one .test file and one gtest test case

I have a gtest test case that can be launched from a rostest .test file. I would like to run the same test with multiple parameters. I came across using ARG in cmake we can set multiple params for the ...
user avatar
0 votes
1 answer
6 views

Process dies for test.py with "option --gtest_output not recognized" error

Running test cases in a subclass of unittest.TestCase via rostest fails with the following error. ...
IsaacS's user avatar
  • 4,502
0 votes
1 answer
13 views

python rostest fails to import python module

Hello, I'm using ROS kinetic on an ubuntu 16.04 machine and have been trying to use rostest to run unit tests (and hopefully integration tests in the future). I keep running into problems when trying ...
user avatar
0 votes
1 answer
42 views

How to test a ros package

My goal is to check if a ROS package has been installed from source correctly and can work without any error. So I'm looking for a common way to do such a test. I've downloaded the source code of the ...
user avatar
0 votes
1 answer
4 views

rostest: fails when using ROS_HOSTNAME (single PC)

My rostest fails with this error: Couldn't find an AF_INET address for [mypc.local] It does not fail consistently in the same place. I have no problems with: ...
user avatar
0 votes
1 answer
16 views

rostest: specifying a single test case

How do I tell rostest to only run a single specific test method in a python unittest.TestCase class? I can execute the full test suite with: rostest foo foo.test ...
user avatar
0 votes
1 answer
4 views

Packaging error trying to run ROS tests from Tox

When I run tox to run Python tests in my ROS package, I'm getting the error: ...
user avatar
0 votes
1 answer
3 views

how to start rostest file on startup?

Has anybody implemented the rostest file that would be launched on startup? All I did now was to type the command make run_tests in the ...
user avatar
0 votes
1 answer
27 views

Show ROS_DEBUG ROS_INFO with catkin_make run_tests

Hi! I create a minimal example in order to illustrate my question. If i do the following small testcase: ...
user avatar
0 votes
1 answer
16 views

Dealing with sleeps in rostest

I am trying to use rostest (coupled with gtest) to do some black box testing of our ROS nodes. So, naturally, if I am to test some node, the launch file for rostest will look like this: ...
user avatar
0 votes
1 answer
22 views

Python rostest succeeds and fails

When i run the unit test using rostest command it fails, when I run it using rosrun it always succeeds. ROSRUN: ALWAYS SUCCEEDS I am trying to create simple unit test that does nothing, it always ...
user avatar
0 votes
1 answer
17 views

Cannot subscribe to own topics (in rostest)

I'm still writing integration test and I'm stuct at asimple exmaple where I want my testcase to publish a message and also subscrib to the same topic ...
user avatar
0 votes
1 answer
13 views

How are several test cases in a ROS test node executed?

If a ROS test node (like hztest) does contain more than one test case how are they executed then? (Each with or without a new execution environment? What execution order?) Originally posted by ...
user avatar
0 votes
1 answer
13 views

How can I use rosunit to unit test ROS nodes?

I found the package rosunit (wiki.ros.org / GitHub) which seems to target unit testing of single ROS nodes (in comparison to rostest which targets integration ...
user avatar
0 votes
1 answer
37 views

How can I use test nodes in rostest which are not part of rostest itself?

I want to test a ROS node with rostest but with a test node which is not included in rostest itself. Means instead of using the hztest test node like in this ...
user avatar
0 votes
1 answer
56 views

rostest does not show log message

Hi everyone, I have an annoying problem of dispalying the ros log message during testing. I have some functions showing ROS_ERROR when errors occur and a test program to test these error cases. If I ...
user avatar
0 votes
1 answer
6 views

Why are my rostests giving me a std::bad_alloc error?

I'm porting my ROS code from Indigo on Ubuntu 14.04 to using the newer ROS Kinetic on Ubuntu 16.04. What I've noticed is that, in one particular test, I will occasionally get a ...
user avatar
0 votes
1 answer
14 views

Rostest and move_base actionlib

Hi I have a package which relies on the move_base action server interface. Is it possible to mock the move_base server in rostest/gtest, so i can perform unittests? I have tried creating a simple ...
user avatar
0 votes
1 answer
17 views

Structure a ROS node for easily testing

Since I've started using ROS few years ago, I used to simplify my life with basic templates like the following: ...
user avatar
0 votes
1 answer
8 views

rostest fails when run using "catkin_make run_tests"

Hi all, I have a node and some_test.test file like this: ...
user avatar
0 votes
1 answer
7 views

Use gtest to catch segfaults

I'm not sure how to get catkin to catch segfaults during testing. I've setup a ROS gtest using the following line in my CMakeLists: ...
user avatar
0 votes
1 answer
9 views

Are there any real world rostest examples using parameters?

The last snippet at http://wiki.ros.org/rostest/Writing defines a parameter. However, I could not find any code I could test that show cases that this actually works. Originally posted by chaoflow on ...
user avatar
0 votes
1 answer
14 views

Tests if ros master is not running using rostest

I like to write a test for a feature that detects if ros master is not running. Using rostest, which automatically starts ros master, is there a way to achieve this?...
IsaacS's user avatar
  • 4,502
0 votes
1 answer
4 views

Defining a dependency for (a Python) add_rostest call?

I have a unit test written in Python that depends on a package that generates messages. If I run catkin_make run_tests --only-pkg-with-deps my_package, the test ...
user avatar
0 votes
2 answers
18 views

build and run only one rostest

I have add_rostest_gtest(TestClassA test/ClassA.test src/test/TestClassA.cpp) add_rostest_gtest(TestClassB test/ClassB.test src/test/TestClassB.cpp) and I want to ...
user avatar
0 votes
1 answer
9 views

How do I test a service caller in python?

I have a python class that has a method that calls a ROS service. I'd like to test that class's method. My going in approach is to create a mock service, call it, and validate the calls are working. ...
user avatar
0 votes
2 answers
21 views

rostest error: Test Fixture Nodes failed to launch

Hello. I am a newbie on ROS. I tried to test some codes with rostest, but error occured. Would you give me some clues to fix it? Thank you. The error message is: ...
user avatar
0 votes
1 answer
36 views

catkin run_tests with stdout output of rostest

I'm using rostest by adding add_rostest in CMakelists.txt, and catkin_tools to build it. I know how to test specific package with ...
user avatar
0 votes
2 answers
6 views

Port to connect to rostest rosmaster after Indigo

Connecting to rosmater with specific port number used to be possible. I see this pull request against Indigo that randomizes the ...
IsaacS's user avatar
  • 4,502
0 votes
1 answer
3 views

rostest not finding the actual test

Hey, I am trying to create a functional test. My node is a C++ ROS node for face detection which works independently. My test file (functional_tests.py) follows: ...
user avatar
0 votes
1 answer
6 views

How to rostest a single (entire) package in catkin workspace?

(I believe related to http://answers.ros.org/question/62583/how-do-i-only-run-tests-for-only-one-package/) I have found through painful trial-and-error that when ...
user avatar
1 vote
2 answers
35 views

rostest & Python - Multiple Test Fixtures In Single File

With integration testing and rostest with Python, is it possible to define multiple test fixtures (classes inheriting from unittest.TestCase) and run them from a ...
user avatar
0 votes
1 answer
2 views

trigger python rostest with catkin_make test

the goal: I want to trigger a python unit-test trough rostest in the ros-enviroment by calling catkin_make test in the package-root. the version of ros is hydro ...
user avatar
0 votes
2 answers
23 views

How to verify publications using rostest?

I have several pieces of software in ROS, all of which are pretty thoroughly unit and integration tested. However, there's one aspect of testing within ROS that I have yet to accomplish with much ...
user avatar
0 votes
1 answer
40 views

Running rostests with bag data

I'm in the processing of standing up some regression tests, and my tests require that I can play back bag data against my node, and then monitor the output. rostest ...
automatom's user avatar
  • 5,602
0 votes
1 answer
1 view

ROS Answers SE migration: rostest on pr2

Is it possible to use rostest on the PR2? I'm running them fine in simulation with pr2_gazebo. When I run on the real PR2 (of course without pr2_gazebo) I see: ...
user avatar
0 votes
1 answer
4 views

rostest - Executable not rebuilding

I am trying to write rostests for the clear_costmap_recovery package. [relevant code] Is there a way to build the tests for only one package? Running catkin_make or ...
DLu's user avatar
  • 4,294
0 votes
2 answers
12 views

rostest code coverage

I'm writing tests in python, and I'm hoping to use rostest and get a coverage report of my code. I notice on the unittest page it says that this can be done by adding a ...
user avatar
0 votes
2 answers
19 views

rostest - Minimum Working Example

I'm having problems developing tests for a package with catkin, specifically tests that run within a launch file using C++/gtest. You can download my files here. CMakeLists.txt ...
DLu's user avatar
  • 4,294
0 votes
1 answer
27 views

Why am I getting: can't locate node [rosout] in package [rosout]

I am trying to run a rostest from catkin which was added with add_rostest() It runs fine when started with a rostest call directly. But when I try to run it from ...
Christian's user avatar
  • 454