Ask Your Question

How do I use OpenCV's test framework with CMake?

asked 2014-05-28 05:06:49 -0500

qbonnard gravatar image

It seems like OpenCV has a test framework based on GTest. They use it for their own unit tests, but I can not find documentation, examples or tutorials on how to use it outside of OpenCV.

It would be a perfect fit for the tests I intend to implement on our OpenCV-based library, but I do not really know where to start, as I am not really an expert in CMake (which builds our library).

I would very much appreciate help on the setup of some kind of "Hello ts World", i.e. how to configure the main CMakeList.txt and the one in the test directory in order to run tests like the ones found in the modules's test subdirectoriess (e.g. core's test folder)

edit retag flag offensive close merge delete


Note: this is a duplicate of the question I asked on StackOverflow, as @IsaacS suggested it would be nice to have OpenCV related questions here too. I hope this is not bad practice.

qbonnard gravatar imageqbonnard ( 2014-05-28 05:07:49 -0500 )edit

I also posted the answer on StackOverflow, but I can not duplicate it here yet, as I am a new user who needs to wait two days before answering my own question.

qbonnard gravatar imageqbonnard ( 2014-05-28 05:09:43 -0500 )edit

hrrrm, could have saved me some work ;)

berak gravatar imageberak ( 2014-05-28 05:38:28 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2014-06-01 10:15:12 -0500

qbonnard gravatar image

After some research and tests, I answered my own question in my blog : Using OpenCV's test framework (with CMake)

Again, I'm no CMake expert, so comments are welcome!

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2014-05-28 05:06:49 -0500

Seen: 292 times

Last updated: Jun 01 '14