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.

2
  • From your IDE or just on the build-server? Commented Aug 14, 2015 at 10:44
  • @NielsvanReijmersdal, any option actually would be great.
    – amazpyel
    Commented Aug 14, 2015 at 10:47

3 Answers 3

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.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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