Questions tagged [gtest]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
3 answers
20 views

Path to colcon test output directory in a gtest

Is there a way to specify the path to <workspace>/log/test_<date_time>/ from within a gtest executed with colcon test...
Matt's user avatar
  • 11
0 votes
1 answer
41 views

Pass parameters to node using gtest

I am trying to create some tests for a package using the gtest suite. Everything works fine, up to the point when I need to pass the test node some parameters. I can't manage to make the node ...
humble_tanuki1618's user avatar
0 votes
0 answers
16 views

How to run multiple nodes in the gtest?

I have 2 packages in my catkin_ws, pkg1 and pkg2. I want to run gtest for pkg1 but it requires pkg2 to receive the data before ...
Jeonghyun Jo's user avatar
0 votes
1 answer
14 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
14 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 ...
Dan Ambrosio's user avatar
0 votes
0 answers
59 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 ...
Tijs van der Smagt's user avatar
0 votes
1 answer
71 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 ...
user avatar
0 votes
1 answer
76 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, ...
user avatar
0 votes
1 answer
84 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 ...
user avatar
0 votes
1 answer
5 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 ...
user avatar
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 ...
user avatar
0 votes
1 answer
62 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: ...
user avatar
0 votes
1 answer
18 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 ...
user avatar
0 votes
1 answer
50 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 ...
user avatar
0 votes
1 answer
14 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
3 views

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 ...
user avatar
0 votes
1 answer
11 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: ...
user avatar
0 votes
1 answer
18 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
13 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
16 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
7 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 ...
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
10 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 ...
user avatar
0 votes
4 answers
8 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 ...
user avatar
0 votes
1 answer
12 views

No rule to make target for gTest

While using $ catkin_make run_tests_test_pkg, the following error is generated by cmake: ...
user avatar
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, ...
user avatar
0 votes
2 answers
17 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
30 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,572
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 ...
user avatar
0 votes
1 answer
5 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 ...
user avatar
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 ...
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
13 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
4 views

How to install gtest

According to the ros gtest wiki page (http://wiki.ros.org/gtest): ...
user avatar
0 votes
1 answer
3 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 ...
user avatar
0 votes
1 answer
3 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. ...
user avatar
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. ...
user avatar
0 votes
2 answers
3 views

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 ...
user avatar
0 votes
1 answer
6 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 ...
user avatar
0 votes
1 answer
13 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 ...
IsaacS's user avatar
  • 4,502
0 votes
1 answer
16 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 ...
user avatar
0 votes
1 answer
4 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 ...
user avatar
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 ...
user avatar
0 votes
1 answer
12 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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
0 votes
1 answer
4 views

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 ...
user avatar
0 votes
2 answers
9 views

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 ...
user avatar
0 votes
1 answer
10 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 ...
user avatar
0 votes
1 answer
10 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 ...
user avatar