8159834: Add some support for jtreg test headers in IntelliJ langtools project
Add live templates to help creation of jtreg tests Reviewed-by: jlahoda
This commit is contained in:
parent
aba0a631d8
commit
0d9142bf89
@ -235,7 +235,10 @@
|
||||
<target name="idea" depends="-check-langtools.jdk.home">
|
||||
<mkdir dir=".idea"/>
|
||||
<copy todir=".idea" >
|
||||
<fileset dir="make/intellij" excludes="**/src/**"/>
|
||||
<fileset dir="make/intellij">
|
||||
<exclude name="**/src/**"/>
|
||||
<exclude name="**/utils/**"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<condition property="idea.jtreg.home" value="${jtreg.home}" else = "[jtreg.home]">
|
||||
<isset property="jtreg.home"/>
|
||||
|
25
langtools/make/intellij/utils/jtreg-live-templates.xml
Normal file
25
langtools/make/intellij/utils/jtreg-live-templates.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<!--
|
||||
The following live template declarations allow for automatic generation of jtreg test headers.
|
||||
Unfortunately, live templates cannot be shared on a per project base, but they can be easily imported
|
||||
by cutting and paste the following lines inside IntelliJ LiveTemplate settings (this will need to be done only once).
|
||||
-->
|
||||
|
||||
<template name="@test" value="@test * @bug $BUG_ID$ * @summary $BUG_SUMMARY$ * $JTREG_ACTION$ $FILE_NAME$" description="jtreg header (positive test)" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="BUG_ID" expression="groovyScript("_1 ==~ /T\\d{7}/ ? _1.substring(1).take(7) : 'NNNNNNN'", fileNameWithoutExtension())" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="BUG_SUMMARY" expression=""Bug summary"" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="JTREG_ACTION" expression=""@compile"" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="FILE_NAME" expression="fileName()" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="JAVA_COMMENT" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="@test /nodynamiccopyright/" value="@test * @bug $BUG_ID$ * @summary $BUG_SUMMARY$ * $JTREG_ACTION$/fail/ref=$GOLDEN_NAME$ -XDrawDiagnostics $FILE_NAME$" description="jtreg header (negative test)" toReformat="false" toShortenFQNames="true">
|
||||
<variable name="BUG_ID" expression="groovyScript("_1 ==~ /T\\d{7}/ ? _1.substring(1).take(7) : 'NNNNNNN'", fileNameWithoutExtension())" defaultValue="NNNNNNN" alwaysStopAt="true" />
|
||||
<variable name="BUG_SUMMARY" expression=""Bug summary"" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="JTREG_ACTION" expression=""@compile"" defaultValue="" alwaysStopAt="true" />
|
||||
<variable name="GOLDEN_NAME" expression="groovyScript("_1 + '.out'", fileNameWithoutExtension())" defaultValue="out.txt" alwaysStopAt="true" />
|
||||
<variable name="FILE_NAME" expression="fileName()" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="JAVA_COMMENT" value="true" />
|
||||
</context>
|
||||
</template>
|
Loading…
x
Reference in New Issue
Block a user