Skip to content
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

Programmatic Test Cases #49

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Programmatic Test Cases #49

wants to merge 8 commits into from

Conversation

l-Luna
Copy link

@l-Luna l-Luna commented Dec 11, 2024

Currently, making a test case requires a lot of work - a separate Language + FileType + ParserDefinition + ParsingTestCase, all of which are virtually identical between tests. This PR creates generic versions of each of these, so test cases can be defined just by:

  • A grammar file (possibly reused between tests)
  • A root rule to attempt to parse
  • A filename to compare

There's some complication around dynamically creating Languages, since IntelliJ enforces that each language uses a unique class & has a unique identifier. I use the shadowed org.jetbrains.org.objectweb.asm to generate a trivial subclass per grammar, which I think is fine to use for testing, but it might be worth shadowing it ourselves, or finding another way about it - ParsingTestCase does a lot of heavy lifting that would need to be redone though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants