-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Locate .coverage_contracts correctly for subfolder paths (#570)
- Loading branch information
Showing
9 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Testing hooks | ||
const fn = (msg, config) => config.logger.log(msg); | ||
|
||
module.exports = { | ||
skipFiles: ['Migrations.sol'], | ||
silent: process.env.SILENT ? true : false, | ||
istanbulReporter: ['json-summary', 'text'], | ||
} |
18 changes: 18 additions & 0 deletions
18
test/integration/projects/contract-subfolders/contracts/A/ContractA2.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
pragma solidity ^0.5.0; | ||
|
||
import "./../B/ContractB2.sol"; | ||
|
||
contract ContractA is ContractB { | ||
uint x; | ||
constructor() public { | ||
} | ||
|
||
function sendFn() public { | ||
x = 5; | ||
} | ||
|
||
function callFn() public pure returns (uint){ | ||
uint y = 5; | ||
return y; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
test/integration/projects/contract-subfolders/contracts/B/ContractB2.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
pragma solidity ^0.5.0; | ||
|
||
|
||
contract ContractB { | ||
uint x; | ||
constructor() public { | ||
} | ||
|
||
function sendFnB() public { | ||
x = 5; | ||
} | ||
|
||
function callFnB() public pure returns (uint){ | ||
uint y = 5; | ||
return y; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
test/integration/projects/contract-subfolders/hardhat.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require("@nomiclabs/hardhat-truffle5"); | ||
require(__dirname + "/../plugins/nomiclabs.plugin"); | ||
|
||
module.exports={ | ||
networks: { | ||
hardhat: { | ||
gasPrice: 2 | ||
} | ||
}, | ||
solidity: { | ||
version: "0.5.15" | ||
}, | ||
paths: { | ||
sources: './contracts/A' | ||
}, | ||
logger: process.env.SILENT ? { log: () => {} } : console, | ||
}; |
17 changes: 17 additions & 0 deletions
17
test/integration/projects/contract-subfolders/test/contracta2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const ContractA = artifacts.require("ContractA"); | ||
|
||
contract("contracta", function(accounts) { | ||
let instance; | ||
|
||
before(async () => instance = await ContractA.new()) | ||
|
||
it('sends', async function(){ | ||
await instance.sendFn(); | ||
await instance.sendFnB(); | ||
}); | ||
|
||
it('calls', async function(){ | ||
await instance.callFn(); | ||
await instance.callFnB(); | ||
}) | ||
}); |
7 changes: 7 additions & 0 deletions
7
test/integration/projects/contract-subfolders/truffle-config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
networks: {}, | ||
mocha: {}, | ||
compilers: { | ||
solc: {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters