Extend Foundry support testing#1512
Extend Foundry support testing#1512gustavo-grieco merged 10 commits intocrytic:dev-improve-foundry-supportfrom
Conversation
|
Thanks a lot for extending this PR. We will need to test:
Besides that, we will need to ensure that the impact in the codebase is minimized. I think there are a few cases that functions that are already defined elsewhere such as isFailedAssertion. Additionally, use .yaml files instead of passing the config in the code. |
| seed: 1234 | ||
| cryticArgs: ["--solc-remaps", "forge-std/=foundry/forge-std/src/"] | ||
| symExec: true | ||
| symExecSMTSolver: z3 |
There was a problem hiding this comment.
We will probably use bitwuzla instead
src/test/Tests/FoundryTestGen.hs
Outdated
| testForgeCompilation = do | ||
| -- ============================================================================ | ||
| -- Test helpers | ||
| -- ============================================================================ |
There was a problem hiding this comment.
Please keep the document comments format consistent with the rest of our comments.
src/test/Tests/FoundryTestGen.hs
Outdated
| -- General utilities | ||
|
|
||
| -- | Run an IO action that requires forge, failing if forge is not found. | ||
| requireForge :: IO () -> IO () |
There was a problem hiding this comment.
Abstract these two in a single function using arguments. Move into a more general unit test code module.
src/test/Tests/FoundryTestGen.hs
Outdated
| -- Concrete Tests | ||
| -- ============================================================================ | ||
|
|
||
| -- | Verify generated test compiles with forge. |
There was a problem hiding this comment.
Actually, I don't think we need all this code. This tests are the same as normal echidna test, but the target is a foundry project, so they should work with the normal test infrastructure we already have. Check other examples.
|
I think two cases remains untested:
|
e1f3265
into
crytic:dev-improve-foundry-support
* improved support for foundry tests * Extend Foundry support testing (#1512) * Fix lint failures * ci: bump python version to 3.10, clone submodules * some fixes when using foundry mode * Update hevm to `542986dea3bec4f5898731ff48877a7a21811bf4` * Fix bugs in Foundry test generation (#1516) * Fix fallback function bug in Foundry test generation * Fix null byte in argument bug in Foundry test generation * Remove unnecessary config file * Remove unused/redundant imports * Disable Slither in Foundry test gen tests * Conditionally run forge-std tests based on the solc version * Reduce unnecessary test grouping and improve failed assertion messages --------- Co-authored-by: Emilio López <[email protected]> * Update hevm to `41e6d1304411749ea8c816d131991663b5dca67a` * Fix linter and build errors (#1521) * improve foundry stateful invariant testing * fix * Fix foundry test generation linter hints and tests (#1522) * Foundry updates (#1525) * Rename dapptest to foundry and support foundry assertX in assertion mode * Rename basic foundry test contracts dir to `foundry-basic` * Add testing modes to `README` * fixes * fixes * Add support for Foundry assume (#1528) * flake: sync hevm version with stack.yaml * Clarify `optimization` test mode in `README` (#1529) * IS_TEST fix --------- Co-authored-by: Radu Bahmata <[email protected]> Co-authored-by: Emilio López <[email protected]> Co-authored-by: Emilio López <[email protected]>
This PR fixes compilation errors in
checkAssertionsfor Foundry support and adds an end-to-end test for Foundry stateless bug reproduction.