add 'coverage' to generate testing coverage report

pull/99/head
freewind 7 years ago
parent a59b12124c
commit ce41bfb739
  1. 2
      .gitignore
  2. 17
      README.md
  3. 5
      coverage_report.sh
  4. 1
      requirements.txt
  5. 3
      setup.py

2
.gitignore vendored

@ -13,3 +13,5 @@ dist
laser*
lol*
.idea*
htmlcov/
.coverage

@ -41,6 +41,23 @@ $ pip3 install mythril
If you plan to analyze Solidity code you'll also need the [native version of solc](http://solidity.readthedocs.io/en/v0.4.21/installing-solidity.html#binary-packages). Solcjs is not supported.
## Running tests
```bash
pip3 install -r requirements.txt
./all_tests.sh
```
It will run all the tests.
### Generating test coverage report
```bash
./coverage_report.sh
```
It will generate a coverage testing report `htmlcov/index.html` in html format, which will be automatically opened in browser.
## Security analysis
Run `myth -x` with one of the input options described below to run the analysis. This will run the Python modules in the [/analysis/modules](https://github.com/b-mueller/mythril/tree/master/mythril/analysis/modules) directory.

@ -0,0 +1,5 @@
#!/bin/sh
coverage run --source=mythril -m unittest discover -p "*_test.py"
coverage html
open htmlcov/index.html

@ -13,3 +13,4 @@ eth-keyfile>=0.5.1
eth-keys>=0.2.0b3
eth-rlp>=0.1.0
eth-tester>=0.1.0b21
coverage

@ -301,7 +301,8 @@ setup(
'eth-keyfile>=0.5.1',
'eth-keys>=0.2.0b3',
'eth-rlp>=0.1.0',
'eth-tester>=0.1.0b21'
'eth-tester>=0.1.0b21',
'coverage'
],
python_requires='>=3.5',

Loading…
Cancel
Save