Open
Conversation
Collaborator
Author
|
@BowTiedRadone do you want to own this PR? We need to add some test integration with Foundry so we can verify we are catching correctly the failures (at least, for stateless tests) |
Contributor
|
@gustavo-grieco Sure! Thanks. |
* 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 <2642849+elopez@users.noreply.github.com>
* 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`
gustavo-grieco
commented
Mar 2, 2026
elopez
reviewed
Mar 2, 2026
lib/Echidna/SymExec/Common.hs
Outdated
Comment on lines
+41
to
+49
| {-Failure _ _ (Revert msg) -> case msg of | ||
| ConcreteBuf b -> | ||
| -- NOTE: assertTrue/assertFalse does not have the double colon after "assertion failed" | ||
| let assertFail = (selector "Error(string)" `BS.isPrefixOf` b) && | ||
| ("assertion failed" `BS.isPrefixOf` BS.drop txtOffset b) | ||
| in if assertFail || b == panicMsg 0x01 then PBool False | ||
| else PBool True | ||
| _ -> error "Non-concrete revert message in assertion check" | ||
| -} |
Member
There was a problem hiding this comment.
is this needed? if not, can you remove the commented out code?
lib/Echidna/Campaign.hs
Outdated
Comment on lines
+291
to
+292
| liftIO $ print symTxs | ||
| liftIO $ print partials |
Member
There was a problem hiding this comment.
is this used? It looks like it might be debug prints
| filterMethodsWithArgs ms = | ||
| case NE.filter (\(n, xs) -> T.isPrefixOf "invariant_" n || not (null xs)) ms of | ||
| [] -> error "No dapptest tests found" | ||
| case NE.filter (\(n, xs) -> T.isPrefixOf "test" n || (T.isPrefixOf "invariant_" n || not (null xs))) ms of |
lib/Echidna/Test.hs
Outdated
| isDapptestMode _ = False | ||
| isFoundryMode :: TestMode -> Bool | ||
| isFoundryMode "foundry" = True | ||
| isFoundryMode _ = False |
Member
There was a problem hiding this comment.
Suggested change
| isFoundryMode _ = False | |
| isFoundryMode _ = False |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Foundry tests should be able to be used, as much as possible. In particular, we could re-use all the test infrastructure, for stateless tests. We want to eventually reach some decent level of compatibility.