-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Support inline configuration in Solidity tests #7355
Copy link
Copy link
Open
Labels
_priority:P1High priorityHigh prioritytype:KREnd-to-end implementation of a KREnd-to-end implementation of a KR
Milestone
Description
Foundry supports inline configuration per Solidity Test file, where the config is set in the comment of the test function:
/// forge-config: default.fuzz.runs = 512
function testEncodeBytesArray(bytes[] memory input) external pure {
bytes[] memory list = new bytes[](1);
list[0] = RLP.encode(input);
assertEq(RLP.encoder().push(input).encode(), RLP.encode(list));
}Note comments can be either /// or block comments /** ... */.
Support for per test configuration has been included in EDR. Hardhat needs to parse the Solidity test files to find test functions with comments that include inline config.
The first suggestion for an approach is:
- compile the test contracts
- read the solc artifacts for the test contracts pulling out the AST
- find the comment against each test function in each test contract
- parse each comment and pass any config per test into EDR for Solidity Test
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
_priority:P1High priorityHigh prioritytype:KREnd-to-end implementation of a KREnd-to-end implementation of a KR
Type
Projects
Status
In Progress