-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8358600: Template-Framework Library: Template for TestFramework test class #25643
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
8358600: Template-Framework Library: Template for TestFramework test class #25643
Conversation
👋 Welcome back epeter! A progress list of the required criteria for merging this PR into |
@eme64 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 97 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
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.
Thank you for your continued work on the Template Framework. This seems like good start to the template library. While it already looks good, I have a few small questions :)
.../hotspot/jtreg/testlibrary_tests/template_framework/examples/TestWithTestFrameworkClass.java
Outdated
Show resolved
Hide resolved
"p.xyz", "InnerTest", | ||
// List of imports. Duplicates are permitted. | ||
List.of("compiler.lib.generators.*", | ||
"compiler.lib.ir_framework.*", |
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.
"compiler.lib.ir_framework.*", |
This should not be needed since its imported by default in TestFrameworkClass
. Or is this a deliberate duplication?
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.
Yes, it was deliberate. But I'll just remove it.
*/ | ||
public static String render(final String packageName, | ||
final String className, | ||
final List<String> imports, |
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.
To eliminate duplicate imports this could also be a Set
.
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.
Sure, I'll make it a Set
.
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.
Thank you for your continued work on the Template Framework. This seems like good start to the template library. While it already looks good, I have a few small questions :)
@mhaessig Thanks for reviewing! I applied you suggestions :) |
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.
Thank you for addressing my comments. Looks good to me!
@mhaessig Thank you 😊 |
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.
Otherwise, looks good!
public class #className { | ||
// --- CLASS_HOOK insertions start --- | ||
""", | ||
Hooks.CLASS_HOOK.anchor( |
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.
Ah, so I can insert here from my testTemplateTokens
right? Do you also want to show an example in TestWithTestFrameworkClass
that this is possible? Maybe we can also add something in the description above since I only got aware of that now when seeing this anchor()
.
@chhagedorn I added a comment and example with the hook insertion :) |
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.
Thanks for adding the hint!
@mhaessig @chhagedorn Thanks for reviewing and for all the helpful suggestions 😊 |
/integrate |
Going to push as commit b85fe02.
Your commit was automatically rebased without conflicts. |
We might want to write many IR/TestFramework tests, and so I would like to integrate a Template that generates the class, and the user has to only generate a list of tests.
This is a first extension for #24217. I had already prototyped it earlier and plan to use it in multiple tests #23418 (see
IRTestClass.java
).jdk/test/hotspot/jtreg/compiler/lib/template_framework/library/TestFrameworkClass.java
Lines 36 to 45 in dc640cb
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25643/head:pull/25643
$ git checkout pull/25643
Update a local copy of the PR:
$ git checkout pull/25643
$ git pull https://git.openjdk.org/jdk.git pull/25643/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25643
View PR using the GUI difftool:
$ git pr show -t 25643
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25643.diff
Using Webrev
Link to Webrev Comment