-
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.
Use recursive-readdir to resolve test files (#451)
- Loading branch information
Showing
15 changed files
with
179 additions
and
14 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
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,4 @@ | ||
module.exports = { | ||
"silent": false, | ||
"istanbulReporter": [ "json-summary", "text"] | ||
} |
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 @@ | ||
const { loadPluginFile } = require("@nomiclabs/buidler/plugins-testing"); | ||
loadPluginFile(__dirname + "/../plugins/buidler.plugin"); | ||
usePlugin("@nomiclabs/buidler-truffle5"); | ||
|
||
module.exports={ | ||
defaultNetwork: "buidlerevm", | ||
logger: process.env.SILENT ? { log: () => {} } : console, | ||
}; |
17 changes: 17 additions & 0 deletions
17
test/integration/projects/tests-folder/contracts/ContractA.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 ContractA { | ||
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/tests-folder/contracts/ContractB.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 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/tests-folder/contracts/ContractC.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 ContractC { | ||
uint x; | ||
constructor() public { | ||
} | ||
|
||
function sendFn() public { | ||
x = 5; | ||
} | ||
|
||
function callFn() public pure returns (uint){ | ||
uint y = 5; | ||
return y; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
test/integration/projects/tests-folder/contracts/Migrations.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,23 @@ | ||
pragma solidity >=0.4.21 <0.6.0; | ||
|
||
contract Migrations { | ||
address public owner; | ||
uint public last_completed_migration; | ||
|
||
constructor() public { | ||
owner = msg.sender; | ||
} | ||
|
||
modifier restricted() { | ||
if (msg.sender == owner) _; | ||
} | ||
|
||
function setCompleted(uint completed) public restricted { | ||
last_completed_migration = completed; | ||
} | ||
|
||
function upgrade(address new_address) public restricted { | ||
Migrations upgraded = Migrations(new_address); | ||
upgraded.setCompleted(last_completed_migration); | ||
} | ||
} |
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,15 @@ | ||
const ContractA = artifacts.require("ContractA"); | ||
|
||
contract("contracta", function(accounts) { | ||
let instance; | ||
|
||
before(async () => instance = await ContractA.new()) | ||
|
||
it('sends [ @skipForCoverage ]', async function(){ | ||
await instance.sendFn(); | ||
}); | ||
|
||
it('calls [ @skipForCoverage ]', async function(){ | ||
await instance.callFn(); | ||
}) | ||
}); |
15 changes: 15 additions & 0 deletions
15
test/integration/projects/tests-folder/test/folder/contractb.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,15 @@ | ||
const ContractB = artifacts.require("ContractB"); | ||
|
||
contract("contractB [ @skipForCoverage ]", function(accounts) { | ||
let instance; | ||
|
||
before(async () => instance = await ContractB.new()) | ||
|
||
it('sends', async function(){ | ||
await instance.sendFn(); | ||
}); | ||
|
||
it('calls', async function(){ | ||
await instance.callFn(); | ||
}) | ||
}); |
20 changes: 20 additions & 0 deletions
20
test/integration/projects/tests-folder/test/folder/contractc.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,20 @@ | ||
const ContractC = artifacts.require("ContractC"); | ||
|
||
contract("contractc", function(accounts) { | ||
let instance; | ||
|
||
before(async () => instance = await ContractC.new()) | ||
|
||
it('sends', async function(){ | ||
await instance.sendFn(); | ||
}); | ||
|
||
it('calls', async function(){ | ||
await instance.callFn(); | ||
}) | ||
|
||
it('sends', async function(){ | ||
await instance.sendFn(); | ||
}); | ||
|
||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5038,7 +5038,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: | |
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" | ||
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= | ||
|
||
"minimatch@2 || 3", [email protected], minimatch@^3.0.2, minimatch@^3.0.4: | ||
"minimatch@2 || 3", [email protected], minimatch@^3.0.4: | ||
version "3.0.4" | ||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" | ||
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== | ||
|
@@ -5229,13 +5229,6 @@ node-alias@^1.0.4: | |
chalk "^1.1.1" | ||
lodash "^4.2.0" | ||
|
||
node-dir@^0.1.17: | ||
version "0.1.17" | ||
resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.17.tgz#5f5665d93351335caabef8f1c554516cf5f1e4e5" | ||
integrity sha1-X1Zl2TNRM1yqvvjxxVRRbPXx5OU= | ||
dependencies: | ||
minimatch "^3.0.2" | ||
|
||
node-emoji@^1.10.0: | ||
version "1.10.0" | ||
resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.10.0.tgz#8886abd25d9c7bb61802a658523d1f8d2a89b2da" | ||
|
@@ -6222,6 +6215,13 @@ rechoir@^0.6.2: | |
dependencies: | ||
resolve "^1.1.6" | ||
|
||
recursive-readdir@^2.2.2: | ||
version "2.2.2" | ||
resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" | ||
integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg== | ||
dependencies: | ||
minimatch "3.0.4" | ||
|
||
regenerate@^1.2.1: | ||
version "1.4.0" | ||
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" | ||
|