Questions tagged [gtest]
The gtest tag has no usage guidance.
50
questions
0
votes
0
answers
10
views
Unexpected QoS Behavior in Isolated GoogleTest: `endpoint_qos.depth` mismatch
I have been trying to test some code using an isolated gtest (ament_add_ros_isolated_gtest) that checks the QoS profile used to create a publisher with that ...
0
votes
0
answers
35
views
How to handle cascaded service calls in ROS2 node integration tests with gtest (C++)
I want to write some integration tests for my ROS2 node (Humble) that provides an service which in turn calls a service. While during runtime this works perfectly fine, when I try to create a unit ...
0
votes
1
answer
21
views
ros2 unit testing
Hi there,
I am new to automated testing and I find it quite difficult to find a resource to write my first unit test for CPP files. Is there a tutorial with the general procedure (What commands?: just ...
0
votes
1
answer
15
views
ROS2 gmock for external libraries
Hi all,
I am trying to implement unit testing in my ROS2 project. I used to work with python and ROS1, where I had experience with pytest and nose. Now I am using ROS2-foxy, C++ and I've chosen gtest, ...
0
votes
1
answer
31
views
Colcon test not running gtests
I am busy doing an assignment for school however I am running into an issue. I have a very basic proof of concept to which I have created a test using the google test framework.
When I run colcon test ...
0
votes
1
answer
3
views
Catkin make fails after adding gtest
Hello,
I have a package, that contains custom messages and services. This package was building well and everything was ok. But recently I added gtest to my package ...
0
votes
1
answer
2
views
ROS Answers SE migration: gtest for ROS2
Is there a guide similar to this one that I think it is for ROS that explain how to start writing and using gtest for ROS2 applications?
Also, does calling colcon test run the gtest tests?
Originally ...
0
votes
1
answer
17
views
Rostest and C++: Test node does not exist or is not executable
Hi!
I'm trying to integrate my workspace with GitLab CI and have been encountering this issue in the CI shell:
...
0
votes
1
answer
6
views
[ROS2] correct way to link to created library in gtest
Hi,
I am trying to create some sample unit tests for the package library I am creating. It looks like the library is being created but I get an undefined reference error. it looks like the test code ...
0
votes
1
answer
24
views
[ROS2] cmake can't find ament_gtest
I am trying to create a new package and some unit tests for that package. In the cmake option, I put the find_package(ament_gtest REQUIRED) line to make sure that the system can use gtest. However, it ...
0
votes
1
answer
3
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 ...
0
votes
1
answer
1
view
Gtest errors when compiling workspace
For some time now (due to some update, probably), I have problems with GTest when compiling a workspace.
When installing GTest on the system, libgtest.so and libgtest_main.so are created, and cmake ...
0
votes
1
answer
4
views
Automatically run tests on ROS build farm for pure cmake project
I'm hosting some pure cmake projects ifopt and towr (not dependent on catkin) on the ROS build farm, for which I generate some unit test in my CMakeLists.txt similar to:
...
0
votes
1
answer
3
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:
...
0
votes
1
answer
5
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 ...
0
votes
1
answer
5
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:
...
0
votes
1
answer
2
views
catkin_make test fails due to undefined reference gtest help
Hi helpful ROS answer-ers,
Due to a recent epiphany I have hopped aboard the TDD train, so to give you some context I am pretty new to working with unit testing frameworks, in particular gtest. I ...
0
votes
1
answer
4
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:
...
0
votes
1
answer
3
views
catkin_make test not running my tests
I am trying to use unit tests in ROS for the first time, using gtest.
The binary for my tests is getting built properly in catkin_ws/devel/lib/project_name/project_name_tests. I can run it directly ...
0
votes
4
answers
5
views
Catkin Doesn't Play Nice With Google Mock
My team is currently transitioning from Ubuntu 12.04 and ROS Fuerte to Ubuntu 14.04 and ROS Indigo. All of our software is heavily tested using gtest and gmock. The latter is proving particularly ...
0
votes
1
answer
6
views
No rule to make target for gTest
While using $ catkin_make run_tests_test_pkg, the following error is generated by cmake:
...
0
votes
1
answer
1
view
eclipse project - catkin run tests?
I built eclipse projects for my modules using catkin_make -G"Eclipse CDT4 - Unix Makefiles" but it did not create test targets. It seems that eclipse is set up to just run make this way, ...
0
votes
2
answers
6
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 ...
0
votes
1
answer
9
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 ...
0
votes
1
answer
2
views
Linker error trying to build and run unit tests
I am getting an error from the linker when I attempt to run catkin_make run_tests_my_package`
The error I get is:
/usr/bin/ld: cannot find -lmy_package
collect2: error: ld returned 1 exit status
Under ...
0
votes
1
answer
2
views
gtest testing function with subscriber reference
Im using gtest for writing test suites for my robot. Im trying to test a function that i use to convert my twist message being sent from the Nav Stack or joystick (cmd_vel topic) that is then ...
0
votes
1
answer
2
views
Installing binaries linked against gtest
I have an interesting circumstance where the public API for my package (diagnostics_aggregator) includes a test node which other packages can use as a test fixture in their tests. This test node ...
0
votes
1
answer
2
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 ...
0
votes
2
answers
5
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
...
0
votes
1
answer
2
views
How to install gtest
According to the ros gtest wiki page (http://wiki.ros.org/gtest):
...
0
votes
1
answer
2
views
problem with linking gtests in catkin
I'm migrating my code to catkin. So far so good, but I've been stuck on that one for some time already.
I'm building a package with some unit tests (gtest), and I get linker errors. The weird thing is ...
0
votes
1
answer
2
views
Why isn't Rostest running my gtests in catkin?
I am trying to run a rostest that subscribes to topics of the node it tests. It is made with gtests. Currently, I'm trying to make the rostest deliberately fail using assert_true(false), etc.
...
0
votes
1
answer
1
view
google test in fuerte
What's the recommended best way to integrate Google Test with fuerte/rosmake? I've looked at the wiki pages for gtest, rostest and rosunit, but I'm not sure which is the most up to date/best to use. ...
0
votes
2
answers
1
view
rosmake + make test? Automated testing?
I am wondering how I could automate the build of my unit tests.
Because right now I have to call make test in every package.
But I would like to automate this, to ...
0
votes
1
answer
3
views
gtest problem with main function
Hi,
I have a line.cpp with a main function and some other functions I want to test.
Then I have my utest.cpp with my test cases and another main function to call them.
A solution would be to just ...
0
votes
1
answer
7
views
No executables generated by building unit test cpp with catkin
I'm trying to build by using catkin my gtest testsuite.
catkin_add_gtest replaces ...
0
votes
1
answer
4
views
data files for catkin gtest
I am creating a Unit-Test program for my catkin package, using gtest. I have set up my CMakeLists.txt to compile the unit-test program and link against my package library. In one of the tests, I ...
0
votes
1
answer
2
views
test topic with gtest
hi,
i wanna test a topic, what it actually publish, and when changing something, what the topic then publishes. My problem is, that i need to declare a callback function in the subscribe() member ...
0
votes
1
answer
2
views
how to run gtest unit in groovy
I have built laser_geometry with catkin, no error. as discription in ros wiki about gtest. It will generate a runable test. But there is nothing.
How do I test the package? Someone has used this ...
0
votes
1
answer
3
views
How does rostest work with catkin?
The camera_info_manager package uses rostest to launch a ROS graph for unit testing.
Launching it explicitly works:
$ rostest camera_info_manager unit_test.test
...
0
votes
1
answer
1
view
gtesting a custom class
I created the test/myTest.cpp file, which includes the myClass.h header file.
When I compile with make test I get the error ‘MyClass’ does not name a type, where MyClass is the class defined in ...
0
votes
1
answer
1
view
How to install gtest in OS X mountain lion
Hi
I have been struggling to get ROS to install properly in OS X Mountain Lion. I am very close, but I need to install gtest. This i cannot get it to do automatically through brew because Google does ...
0
votes
1
answer
1
view
Mac OS X install error: No available formula for gtest
Hi Everybody!
I am trying to install ROS Electric on OS X Lion. I follow this tutorial but when I execute the command
...
0
votes
2
answers
1
view
Mocking in ROS?
Hey,
I'm creating tests for my project and I was wondering, is there a mocking package in ROS? I was using gtest for the tests itself so I was expecting gmock, or googlemock, to be in ROS too but I ...
0
votes
1
answer
2
views
gtest fuerte undefined reference when linking
Hey all,
After upgrading to ubuntu precise and fuerte I have a problem when linking my unit tests based on gtest.
I get an undefined reference to pthread_key_create (see below).
Seems this is a ...
0
votes
1
answer
4
views
Installation on gentoo
I am trying to install ROS on the latest version of gentoo and it seems there is a mismatch in the way ROS defines package dependencies. Specifically, rosinstall tries to satisfy dependencies by ...
0
votes
1
answer
3
views
Using rostest with gtest value-parameterized tests
I have a test suite that implements Google's value-parameterized tests using a TEST_P test type and INSTANTIATE_TEST_CASE_P to ...
0
votes
1
answer
2
views
rostest kills roscore
I created a gtest test class for obvious reasons. I made the necessary adjustments to CMakefile.txt, and the package builds both the node and test executables fine. When I run 'make test', the tests ...
0
votes
1
answer
2
views
missing rosdeps for gtest and paramiko running OS: Arch
hello,
I installed a new ARCH system and made a rosinstall for the full desktop. At the end I got an error message because the rosmake for ros and ros_comm did not work. Manually I started the rosmake ...
0
votes
1
answer
1
view
How to link tests but not executables in a ROS package?
I am using Google Test Framework for running tests for my ROS package. I compile and link my test executable using
make tests
and run the tests by issuing command
<...