2

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.

  • From your IDE or just on the build-server? – Niels van Reijmersdal Aug 14 '15 at 10:44
  • @NielsvanReijmersdal, any option actually would be great. – amazpyel Aug 14 '15 at 10:47
1

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.

1

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.