I have successfully set up an autotools project where the tests compiles with instrumentation so I can get a test coverage report.
I can get the report by running lcov in the source dir after a successful 'make check'.
I now face the problem that I want to automate this step. I would like to add this to 'make check' or to make it a separate goal 'make check-coverage'. Ideally I would like to parse the result and fail if the coverage falls below a certain percentage. Problem is that I cannot figure out how to add a custom target at all.
The closest I got was finding this example autotools config, but I can't see where in that project the goal 'make lcov' is added. I can only see some configure flags in m4/auxdevel.m4.
Any tips?