Hi,
I am trying to create a unit test framework using CPPUnit for a large code base. I need to be able to test individual modules, all of which are part of a module tree that begins with a specific root module.
Due to a non-technical reason, I cannot touch the production file (my original approach involved adding an ifdef to the root module). So I thought of another approach, which is to have create copies of the root module headers as well as copies of headers belonging to modules in the intermediate inheritance hierachy. Because of the number of number of modules invovled as well as the size of each module's source. I'm looking for a way to automatically do that merging for me.
So for foo.h, and foo.cpp, I'm looking for a some kind of a tool that'll output fooTest.h, where fooTest.h contains the declaration AND definition of everything that is in foo.cpp/foo.h
Thanks in advance!
EDIT: Thanks for the answers, one thing I forgot to mention is that, the contents of fooTest.h is not supposed to be the merged result of foo.cpp and foo.h . I need to make minor changes to the root fooTest.h in order to make it a suitable mock-module for testing. Thus, simply using includes won't work. I'll look into concatenating the files and see if that solves my problem.