Question: In CPP unit we run unit test as part of build as part of post build setup. We will be running multiple tests as part of this. In case if any test case fails post build should not stop, it should go ahead and run all the test cases and should report summary how many test cases passed and failed. how can we achieve this.

Thanks!

Answer: 
Your question is too vague for a precise answer. Usually, a unit test engine return a code to tell it has failed (like a non zero return code in the shell on linux) or generate some output file with results. The calling system handle this. If you have written it (some home made scripts) you have to give the option to go on tests execution even if an error occurred. If you are using some tools like continuous integration server, then you have to go through the doc and find the option that allows you to go on when tests fails.

A workaround is to write a script that return a "OK" result even if the unit test fails, but there you lose some automatic verification ...

Be more specific if you want more clues.

my2c
I would just write your tests this way. Instead of using the CPPUNIT\_ASSERT macros or whatever you would write them in regular C++ with some way of logging errors.

You could use a macro for this too of course. Something like:

`LOGASSERT( some_expression )`

could be defined to execute some\_expression and to log the expression together with **FILE** and **LINE** if it fails, and you can also log exceptions of course, as well as ones that are not thrown, simply by writing them in your tests (with macros if you want to log the expression that caused them with **FILE** and **LINE**).

If you are writing macros I would advise you to limit the content of your macro to calling an inline function with extra parameters.