Test as a functor - register test functions

Added by Miguel Fernandes over 5 years ago

Hello,

I am trying to implement the wiki example "When the Test is a Functor".

I have created myClassTest.h that has 42 units tests for myClass.h. In Test.cpp, Having suite s, I include my test class with s.push_back(myClassTest()) as described in the example.

It compiles and runs but when I run says that only 1 test was run -> myClassTest. The 42 unit test don't seem to be executed, since i altered one to fail and the output was also green. In myClassTest.cpp I have warnings saying "Test function is not registered". Where and how should I register these tests so that they can be executed when myClassTest is created and pushed back to suite s.

Thanks.
Miguel


Replies (2)

RE: Test as a functor - register test functions - Added by Peter Sommerlad about 5 years ago

I am sorry that your question did go unanswered. When the plug-in marks your test member functions as unregistered then press CTRL-1 or select quick-fix from the context menu. This should automatically generate the registration code. Sorry, without concrete code example it is hard to tell you exactly what your problem was.

RE: Test as a functor - register test functions - Added by Miguel Fernandes over 4 years ago

Hello,

No problem, i was able to get it to work using "CUTE_SMEMFUN(TestClass,test2);"
Cheers,
Miguel

(1-2/2)