From fa1b7b0a5990158d30afcc23cb9d75754d0470fc Mon Sep 17 00:00:00 2001 From: Gustavo Grieco <31542053+ggrieco-tob@users.noreply.github.com> Date: Tue, 11 Jul 2023 17:42:06 +0200 Subject: [PATCH] Show the output of the LCOV report in the README --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d227400d..64c00ce45 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,9 @@ Echidna should find a call sequence that falsifies `echidna_sometimesfalse` and ### Collecting and visualizing coverage -After finishing a campaign, Echidna can save a coverage maximizing **corpus** in a special directory specified with the `corpusDir` config option. This directory will contain two entries: (1) a directory named `coverage` with JSON files that can be replayed by Echidna and (2) a plain-text file named `covered.txt`, a copy of the source code with coverage annotations. +After finishing a campaign, Echidna can save a coverage maximizing **corpus** in a special directory specified with the `corpusDir` config option. This directory will contain two entries: (1) a directory named `coverage` with JSON files that can be replayed by Echidna and a set of human-readable documens to visualize coverage. -If you run `tests/solidity/basic/flags.sol` example, Echidna will save a few files serialized transactions in the `coverage` directory and a `covered.$(date +%s).txt` file with the following lines: +For instance, if you run `tests/solidity/basic/flags.sol` example, Echidna will save a few files serialized transactions in the `coverage` directory and a `covered.$(date +%s).txt` file with the following lines: ```text *r | function set0(int val) public returns (bool){ @@ -81,6 +81,10 @@ Our tool signals each execution trace in the corpus with the following "line mar * `o` if an execution ended with an out-of-gas error * `e` if an execution ended with any other error (zero division, assertion failure, etc) +The same information is available in an html file (`covered.$(date +%s).html`) for improved navigation. Finally, we support for lcov output for visualizing coverage. To generate an html file with the complete set of tested contracts, you need to use [`genhtml`](https://manpages.ubuntu.com/manpages/xenial/man1/genhtml.1.html): + + + ### Support for smart contract build systems Echidna can test contracts compiled with different smart contract build systems, including [Truffle](https://truffleframework.com/) or [hardhat](https://hardhat.org/) using [crytic-compile](https://github.com/crytic/crytic-compile). To invoke echidna with the current compilation framework, use `echidna .`.