# kcov-coverage-fix ![Version](https://img.shields.io/badge/version-0.1.0-blue.svg?cacheSeconds=2592000) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Kogia-sima/kcov-coverage-fix/blob/master/LICENSE) [![Twitter: Kogia\_sima](https://img.shields.io/twitter/follow/Kogia\_sima.svg?style=social)](https://twitter.com/Kogia\_sima) Rustc is known to report an incorrect coverage for some lines (https://stackoverflow.com/questions/32521800/why-does-kcov-calculate-incorrect-code-coverage-statistics-for-rust-programs). `kcov-coverage-fix` will read coverage from cobertura.xml (generated by kcov), fix it, then overwrites the original file. ## How is the incorrect line coverage detected `kcov-coverage-fix` will mark as non-executable line: ### 1. Line that contain only closing braces or only `else` statements ```rust if a > 0 { b = a } else { // <-- marked as "not executable" b = -a }; // <-- marked as "not executable" ``` ### 2. Line that includes struct declaration but not contains struct field declarations. ```rust pub struct Parser { // <-- marked as "not executable" reader: R } ``` ## Author 👤 **Kogia-sima** * Twitter: [@Kogia\_sima](https://twitter.com/Kogia\_sima) * Github: [@Kogia-sima](https://github.com/Kogia-sima) ## 🤝 Contributing Contributions, issues and feature requests are welcome! Feel free to check [issues page](https://github.com/Kogia-sima/kcov-coverage-fix/issues). ## Show your support Give a ⭐️ if this project helped you! ## 📝 License Copyright © 2019 [Kogia-sima](https://github.com/Kogia-sima). This project is [MIT](https://github.com/Kogia-sima/kcov-coverage-fix/blob/master/LICENSE) licensed. *** _This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_