Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Provide path to Coverage to dump .coverage

I'm developing a module1 which has some test cases. I've another module2 which can run these test cases and generate the amount of coverage. Currently the .coverage folder is generated on the current working directory from where the module2 is being called. Is there a way to specify the folder path for coverage to dump this .coverage in the path specified?

like image 958
V.i.K.i Avatar asked Dec 10 '14 10:12

V.i.K.i


1 Answers

Seems like from command line there is no option to do this. But using configuration files this can be done.

In the configuration file keep below lines.

[run]

data_file = < path where .coverage should be stored >

Then run:

coverage run < script > (if configuration file is not specified, it looks for .coveragerc in same folder from when coverage is being run. If this is also not available then defaults are used)

or

coverage run --rcfile < configuration file name > < script name >

like image 79
Vijay Gadde Avatar answered Oct 17 '22 03:10

Vijay Gadde