Tool to do code coverage testing for MFC application.
I am looking for a tool to do code coverage testing for my MFC application. I am new to this and I am exploring cppunit, I feel cppunit is not right for MFC because I need to do coding in main to execute the each functionality test case.
Do you mean unit testing? Coverage testing is something different, although related, whereas you test what coverage your unit tests are giving you. Ideally you want as much coverage as possible. A tool to test coverage would be something like bullseye.
>> I feel cppunit is not right for MFC because I need to do coding in main to execute the each functionality test case.
Why not have a special build of your code just for doing testing, where you include the code required to set up cppunit if a special precompile macro is defined in the project. Normal build wouldn't include this. Most test frameworks will require you to set up before testing. Ordinarily, I code solutions so all the business login is in a DLL and the EXE is just a thin wrapper for the DLL. This way I don't need to test anything in the exe and I can then have a separate test harness that is used to execute the unit tests.