3 ms·
I've recently done that in go-ipfs project for cross package coverage (where tests in one package are counted towards coverage in all the others). You can see t
by Kubuxu 10y ago
I've recently done that in go-ipfs project for cross package coverage (where tests in one package are counted towards coverage in all the others). You can see the results here: https://github.com/ipfs/go-ipfs/blob/ce00f384dc244f04ec7d87ea7eb8b49b9478cdec/coverage/Rules.mk https://github.com/ipfs/go-ipfs/blob/ce00f384dc244f04ec7d87e...
It is quite a bit of coverage and Makefile magic, but it generates coverage results. The same file also allows us to wire in sharness testing (cli tests) to generate coverage report. It is quite important for us as we don't test cli in unit tests just in the sharness.
-------
The magic happens here: https://github.com/ipfs/go-ipfs/blob/ce00f384dc244f04ec7d87ea7eb8b49b9478cdec/coverage/Rules.mk#L15-L19 https://github.com/ipfs/go-ipfs/blob/ce00f384dc244f04ec7d87e...
Each package has its one coverage target, for each package I collect dependencies that are in our testing scope and then I create go test cover call that includes those dependencies.