My current employer doesn't do unit testing (shudder). In fact there is no host based testing at all; everything is tested (black box) on target. And none of it can be automated (the horror! the horror!).
After some nagging I have been very grudgingly given permission to look into host testing - initially at subsystem level. Not ideal, but it's a start, and it can be automated for regression testing porpoises, and, if it works, I might even get to try unit testing.
The build system for the target doesn't have anything as simple as a make file, oh no, indeedie. It has a Bash script, which runs a Perl script, which invokes a few Python scripts, which use XML files to generate build commands on the fly.
I would like to stay well away from it (maybe in the next country, maybe even in the next job).
The subsystem has 200+ .CPP files. Neither source nor header include the .H files which they need, preferring to rely on others to do so (the further horror! the further horror!). Mostly this gets done by the aptly named enums.h (or, do I mean ineptly?).
Question: I am looking for a tool which will scan those 200+ source & associated header files, and figure out which classes, functions, structures, enums, etc are referenced, but not declared and generate mocks/stubs/dummies/WhateverYouCareToCallThem, which I can expand upon for testing?
Thinks: perhaps it could just scan the compiler/linker error messages in order to determine what to create?
Windows or Linux. Preferably free, but as that is so unlikely, if there is something commercial where I can try a demo, I might be able to get them to spring for a license.
Important: it must be able to use the current production code - unchanged. Tools like Google Mocks require me to declare things as virtual solely in order to be able to test.
[Update] I am looking for a free solution which is licensed for commercial use.
PowerMockito
which modifies bytecode to allow some normally not allowed tasks. C++ has no JVM and no reflection you could use to get away with your idea. False objects and Mock objects are drop-in replacements for actual objects - if your code is so tightly coupled that you cannot swap implementations no framework is going to help you anyway. In your case book Working effectively with legacy code by M. Feathers might be what you actually need.