Project (written on pure C language) under test has a lot of files with source code and a lot of unit test cases (more than million files and tests). And we don't want to execute all unit test cases after each changes. That's why we need to execute only unit test cases which relates to changes in source code. I have some thoughts how to do this from scratch. But is it possible to do this task by using some tool or unit-test framework? I really appreciate any help you can provide.
3 Answers
With such a large system, I'm assuming that the code is built into many different individual libraries. One way you can narrow down the list of unit tests is to identify and run only those unit tests that are found in the same library as the code change. This approach also assumes local functions aren't exported to become public outside of the module that has been changed, so it's unlikely that unit tests for a changed function might reside in a different library.
I do not know of any framework/tool that supports this. Have a look at GNU global (http://savannah.gnu.org/projects/global/) - it provides a comprehensive tagging for C programs and command line tools to find references. May be you can build some shell/perl scripts around this to achieve what you want.
Google does this kind of thing. They automatically determine the dependencies in their source code and then use that information to determine what tests to run. You can read about it in How Google Tests Software.
As far as I know, Google's system is proprietary. I do not know of a commercial or open-source equivalent.
-
What about that msdn.microsoft.com/en-us/library/dd286589.aspx ?– amazpyelCommented Aug 31, 2015 at 6:52