From bb447a7ee5fb5af9b7902a5b26e5d650c72a8d7c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 4 Feb 2018 00:07:10 +0000 Subject: [PATCH 1/4] Add coverage and coveralls task to create code coverage report --- package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ba056c3..a451b8aa 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ "lint": "semistandard", "prepublish": "./downloadCurrentVersion.js && ./verifyVersion.js", "pretest": "npm run lint", - "test": "tape ./test/index.js" + "test": "tape ./test/index.js", + "coverage": "istanbul cover node_modules/tape/bin/tape ./test/index.js", + "coveralls": "npm run coverage && coveralls Date: Sun, 4 Feb 2018 00:08:36 +0000 Subject: [PATCH 2/4] Run coveralls on travis --- .travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e245bab..426a3068 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,11 @@ branches: # Pull request automation is not constrained to this set of branches. only: - master -script: npm test +matrix: + fast_finish: true + include: + - os: linux + env: CXX=g++-4.8 TEST_SUITE=test + - os: linux + env: CXX=g++-4.8 TEST_SUITE=coveralls +script: npm run $TEST_SUITE From 0d8bc51141c3c9b1922ed234fe02031484abf919 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 4 Feb 2018 00:18:31 +0000 Subject: [PATCH 3/4] Do not instrument soljson.js in istanbul --- .istanbul.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .istanbul.yml diff --git a/.istanbul.yml b/.istanbul.yml new file mode 100644 index 00000000..adf1748e --- /dev/null +++ b/.istanbul.yml @@ -0,0 +1,3 @@ +instrumentation: + excludes: + - soljson.js From df91d9859e92eb9c87b940b24ea0e7b7fa152f23 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 9 Feb 2018 20:52:29 +0000 Subject: [PATCH 4/4] Add coveralls.io icon to the README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c61c216e..ba34782f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Build Status](https://travis-ci.org/ethereum/solc-js.svg?branch=master)](https://travis-ci.org/ethereum/solc-js) +[![Build Status](https://img.shields.io/travis/ethereum/solc-js.svg?branch=master&style=flat-square)](https://travis-ci.org/ethereum/solc-js) +[![Coverage Status](https://img.shields.io/coveralls/ethereum/solc-js.svg?style=flat-square)](https://coveralls.io/r/ethereum/solc-js) # solc-js JavaScript bindings for the [Solidity compiler](https://github.com/ethereum/solidity).