Skip to content

Commit bfe65be

Browse files
maxsam4adamdossa
authored andcommitted
Solidity Coverage Fix (#328)
* Updated test script * Updated travis script * Mac Compatibility * Ignored mocks and oracles in test coverage
1 parent c6d448e commit bfe65be

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

.solcover.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ module.exports = {
44
copyPackages: ['openzeppelin-solidity'],
55
testCommand: 'node ../node_modules/.bin/truffle test `find test/*.js ! -name a_poly_oracle.js -and ! -name s_v130_to_v140_upgrade.js` --network coverage',
66
deepSkip: true,
7-
skipFiles: ['external', 'flat', 'helpers']
7+
skipFiles: ['external', 'flat', 'helpers', 'mocks', 'oracles'],
8+
forceParse: ['mocks', 'oracles']
89
};

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ before_install:
1212
- sudo apt-get -y install solc
1313
before_script:
1414
- truffle version
15+
- wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js
1516
script:
1617
- npm run test
1718
notifications:

scripts/test.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,25 +94,16 @@ else
9494
fi
9595

9696
if ! [ -z "${TRAVIS_PULL_REQUEST+x}" ] && [ "$TRAVIS_PULL_REQUEST" != false ]; then
97-
mkdir tempPoly
98-
mv contracts/modules/TransferManager/SingleTradeVolumeRestrictionManager.sol tempPoly/SingleTradeVolumeRestrictionManager.sol
99-
mv contracts/modules/TransferManager/SingleTradeVolumeRestrictionManagerFactory.sol tempPoly/SingleTradeVolumeRestrictionManagerFactory.sol
100-
mv test/x_single_trade_volume_restriction.js tempPoly/x_single_trade_volume_restriction.js
97+
curl -o node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js
10198
node_modules/.bin/solidity-coverage
102-
10399
if [ "$CONTINUOUS_INTEGRATION" = true ]; then
104100
cat coverage/lcov.info | node_modules/.bin/coveralls
105101
fi
106-
107-
mv tempPoly/SingleTradeVolumeRestrictionManager.sol contracts/modules/TransferManager/SingleTradeVolumeRestrictionManager.sol
108-
mv tempPoly/SingleTradeVolumeRestrictionManagerFactory.sol contracts/modules/TransferManager/SingleTradeVolumeRestrictionManagerFactory.sol
109-
mv tempPoly/x_single_trade_volume_restriction.js test/x_single_trade_volume_restriction.js
110-
rm -rf tempPoly
111102
else
112103
# Do not run a_poly_oracle,js tests unless it is a cron job from travis
113104
if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then
114105
node_modules/.bin/truffle test `ls test/*.js`
115106
else
116107
node_modules/.bin/truffle test `find test/*.js ! -name a_poly_oracle.js -and ! -name s_v130_to_v140_upgrade.js`
117108
fi
118-
fi
109+
fi

0 commit comments

Comments
 (0)