2. Re: eui -coverage
- Posted by mattlewis (admin) Sep 27, 2010
- 1134 views
What's coverage?
It's meant to help you determine the amount of your code tested via unit testing. It's still undocumented. If you've got the source checked out, you can do:
$ make interpreter $ make coverageThis runs eutest with the interpreter only, and builds a database of coverage for the standard library. There's a post-processor, bin/eucoverage.ex that generates html reports on the coverage of the test suite. Here is an oldish example (the format may have changed a bit since then, and the data certainly has):
http://mattlewis.users.sourceforge.net/unit-test/
Here's the nearest thing to documentation, from the dev mail list:
-coverage [file|dir] This specifies what files to gather stats for. If you supply a directory, it recurses. Only files that are obviously euphoria are included (.e, .ew, .eu, .ex, .exw, .exu).
-coverage-db <file> This one allows you to specify a specific location and name for the database where coverage information is stored. It's an EDS database. By default, the DB is eui-cvg.edb.
-coverage-erase Tells the interpreter to start over. By default, multiple runs accumulate coverage in the DB.
Run bin/eucoverage.ex <coverage database> to generate the reports. It creates a subdirectory where the coverage database is located with the same name as the base of the database file name. In that directory, there will be an index page, a css file and a subdirectory. The index file is a summary of all of the files for which there are any stats. You can drill into each file to see the details of what was executed. "
Since then, those have been added to eutest, with the addition of the -coverage-pp parameter with eutest that tells eutest how to post process the coverage data. Also, there is:
-coverage-exclude <patern>
Matt