mesalock-linux / mesabox

A collection of core system utilities written in Rust for Unix-like systems (and now Windows)
BSD 3-Clause "New" or "Revised" License
137 stars 19 forks source link

Test coverage is not accurate #43

Open mssun opened 6 years ago

mssun commented 6 years ago

Everything works well except for files/functions under shell. I don't why the integration test cases for shell will not emit hit counts. Therefore, the test coverage for posix/sh is not accurate.

Arcterus commented 6 years ago

Can you test the coverage on the sh-parser branch? It no longer uses nom so I'm curious if that helped at all.

mssun commented 6 years ago

Still zero coverage for parser.rs: https://codecov.io/gh/mesalock-linux/mesabox/tree/373875043044f1f248f48477d3cf19f92fab8273/libmesabox/src/posix/sh

Arcterus commented 6 years ago

Not sure what the problem is then :/

mssun commented 6 years ago

I found that the libmesabox test (unit tests) reported coverage statistics of parser.rs (though zero coverage because of no unit tests for parser I guess). However, if we only look at the integration tests, here is no report of parser.rs for the integration tests. This is wired. This implies that all symbols of parser.rs are missing and the file is also not included in the report.

mssun commented 6 years ago

Another case is that the parser_num function is explicitly called by tests, but the coverage results show it was not hit. https://codecov.io/gh/mesalock-linux/mesabox/src/master/libmesabox/src/posix/head.rs#L339

mssun commented 6 years ago

With further investigation, I found that functions in validator_os in clap will not be counted.