Let's cover ourselves with istanbul

Also includes the fix for #39, albeit with a changed path to the
index file (README updated appropriately)
uport
Alex Rea 8 years ago
parent 6982d5f34a
commit 427c9a60c0
  1. 2
      README.md
  2. 6
      circle.yml
  3. 4
      package.json
  4. 2
      runCoveredTests.js

@ -57,7 +57,7 @@ From inside the SolCover directory, run
```node ./runCoveredTests.js``` ```node ./runCoveredTests.js```
Upon completion of the tests, open the `./coverage/index.html` file to browse the HTML coverage report. Upon completion of the tests, open the `./coverage/lcov-report/index.html` file to browse the HTML coverage report.
###A few, uh, provisos, a, a couple of quid pro quos... ###A few, uh, provisos, a, a couple of quid pro quos...
It is very likely that there are valid Solidity statements that this tool won't instrument correctly, as it's only been developed against a small number of contracts. If (and when) you find such cases, please raise an issue. It is very likely that there are valid Solidity statements that this tool won't instrument correctly, as it's only been developed against a small number of contracts. If (and when) you find such cases, please raise an issue.

@ -5,4 +5,8 @@ dependencies:
pre: pre:
- npm install -g truffle - npm install -g truffle
- rm -rf node_modules/ - rm -rf node_modules/
test:
override:
- npm run test-cov
post:
- bash <(curl -s https://codecov.io/bash)

@ -7,7 +7,8 @@
"test": "test" "test": "test"
}, },
"scripts": { "scripts": {
"test": "mocha --timeout 30000" "test": "mocha --timeout 30000",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --timeout 30000"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",
@ -24,6 +25,7 @@
"ethereumjs-account": "~2.0.4", "ethereumjs-account": "~2.0.4",
"ethereumjs-tx": "1.1.2", "ethereumjs-tx": "1.1.2",
"ethereumjs-util": "~4.5.0", "ethereumjs-util": "~4.5.0",
"istanbul": "^0.4.5",
"merkle-patricia-tree": "~2.1.2", "merkle-patricia-tree": "~2.1.2",
"mocha": "^3.1.0", "mocha": "^3.1.0",
"solc": "0.4.6" "solc": "0.4.6"

@ -53,7 +53,7 @@ coverage.generate(events, './../originalContracts/');
fs.writeFileSync('./coverage.json', JSON.stringify(coverage.coverage)); fs.writeFileSync('./coverage.json', JSON.stringify(coverage.coverage));
shell.exec("./node_modules/istanbul/lib/cli.js report html") shell.exec("./node_modules/istanbul/lib/cli.js report lcov")
testrpcProcess.kill(); testrpcProcess.kill();
shell.rm('-rf', './../contracts'); shell.rm('-rf', './../contracts');
shell.mv('./../originalContracts', './../contracts'); shell.mv('./../originalContracts', './../contracts');

Loading…
Cancel
Save