Gtest
Add unit testing to wolf with googletest.
If the BUILD_TESTS
option is enable in the top level CMakeLists.txt
it will retrieve googletest from github and compiles it.
Then all wolf-tests present in the test
folder are compiled in one single executable.
This executable can be break-down into smaller chunks - see test/CMakeLists.txt
Provide a very simple test as an example.
Merge request reports
Activity
To test this PR:
- if you built with
catkin build
, you can run tests withcatkin build -v --make-args test
, or to execute them individually :
$ cd ~/my_wolf_ws/build/wolf/bin $ ./gtest_example
- or if you built with
cmake/make
:
$ cd ~/path_to_wolf_root $ ctest
or or to execute them individually:
$ cd ~/path_to_wolf_root/bin $ ./gtest_example
Edited by Jeremie Deray- if you built with
Added enhancement label
Mentioned in issue #18 (closed)
@jsola here you go, I've move tests to the
test/CMakeLists.txt
Please try it before merging to be sure everything goes well on another machine than mine.
Moreover if the
ctest
command still work fine, thecatkin run_tests
command do not see them anymore. I guess I will worry about it once we merge !81 (closed) .Mentioned in merge request !85 (closed)
@jsola any news here ?
Mentioned in issue #59 (closed)
I cannot follow your instructions. Please be precise otherwise it's a lot of time for me to figure out:
jsola@encantats:~/dev/wolf/build$ ctest --VV Test project /home/jsola/dev/wolf/build No tests were found!!!
and also
jsola@encantats:~/dev/wolf/build$ ./gtest_example bash: ./gtest_example: No such file or directory
of course this is not the right folder, but it is not in /bin either.
Added 671 commits:
-
5b288c95...fe72f437 - 668 commits from branch
master
- 008cc1b5 - add gtest
- 3bcee1dd - add dummy gtest as an example
- cd210f20 - fix func wolf_add_gtest
Toggle commit list-
5b288c95...fe72f437 - 668 commits from branch
@jsola I have rebased this pr on top of master & updated the commands in the first post of this thread.
Please let me know if you encounter any issue.Mentioned in commit 33edd5c5