For a class project I have to use gcov to test coverage of a file that doesn’t have a main function, but is called by a file with a main function. So there’s a .c file that has all of the library calls we’ve been writing and then there’s a .c file that tests those calls. The problem is if I use gcov it only works with the executable .c file and doesn’t show coverage of the function calls in the other .c file.
Does anybody know if there’s a way around this?
My compile flags were off when compiling my source. I needed to also compile with -lgcov and –coverage