-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unreliable ASTJson tests #12696
Fix unreliable ASTJson tests #12696
Conversation
babfb44
to
2ac041e
Compare
2ac041e
to
ff44c8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some remarks but overall I like the direction it's going in.
70383f5
to
09ce867
Compare
3683b5a
to
e2d37a0
Compare
|
||
if (m_variants.empty()) | ||
BOOST_THROW_EXCEPTION(runtime_error("Missing file with expected result for: \"" + _filename + "\".")); | ||
|
||
ifstream file(_filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why all the stuff starting from here cannot be done by TestCaseReader
instead? Not that it's strongly related to the issue at hand, but still...
What will happen, if I add To me it would seem that, ideally, the solidity source file fully determines what variants are expected with its settings and a run of But I may have missed some discussion on this. |
@ekpyron Yes, the idea was to run variants based on which files are present. I am not sure if we can depend on *.sol file only. In fail_after_parsing test we expect a compilation fail after parsing. But even so, in the second test variant, a result AST is enriched by "exportedSymbols". Do you think the second variant makes not sense? |
I don't think there is any way to make the compiler output an AST on the |
Thank you for the quick response! It is all clear now. I will update code to validate the test variants based on the "failAfter" marker. |
fa0e9be
to
f3620b3
Compare
@ekpyron I updated PR with JSONs/variants validation. Please let me know if this is what you expected to see. |
2b2a8ee
to
4bd61f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still wondering about #12696 (comment) - but we don't need to change this in the same PR, even if we want to change it, I guess.
Also I'd still consider always expecting and checking a parseOnly
file, but arguably it's also fine to merely check it if it's there...
So since regardless of either of that, this PR is definitely an improvement, I'm approving.
Please squash |
0d6557c
to
8a254b7
Compare
done |
fixes #12621
ASTJson test variants are generated based on JSON file availability. Then they are validated against "failAfter" marker in a solidity source file. If the "failAfter" marker is not here all generated test variants are accepted. Otherwise, compiler state in test variant is compared against "failAfter" marker. If it is later in compilation steps order, the test is interrupted with exception.