aboutsummaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorsundar <none@none>2014-06-16 08:55:58 +0530
committersundar <none@none>2014-06-16 08:55:58 +0530
commit551861415cebed7eb14f1ee644d2d5e8fdf075db (patch)
tree2e8f25a797f5c7baa842cfefe45f0b496dec817c /make
parentfdd645c487a49b6d4757d89468f442daf2094c6a (diff)
downloadnashorn-551861415cebed7eb14f1ee644d2d5e8fdf075db.tar.gz
8044517: Run & debug single Nashorn test
Reviewed-by: lagergren, attila Contributed-by: jaroslav.tulach@oracle.com
Diffstat (limited to 'make')
-rw-r--r--make/build.xml69
-rw-r--r--make/nbproject/ide-file-targets.xml36
-rw-r--r--make/nbproject/project.xml22
3 files changed, 61 insertions, 66 deletions
diff --git a/make/build.xml b/make/build.xml
index f418ad1e..3b30a089 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -351,52 +351,71 @@ grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
<echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under test/lib directory."/>
</target>
- <target name="test" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
- <fileset id="test.classes" dir="${build.test.classes.dir}">
- <include name="**/api/javaaccess/*Test.class"/>
- <include name="**/api/scripting/*Test.class"/>
- <include name="**/codegen/*Test.class"/>
- <include name="**/parser/*Test.class"/>
- <include name="**/runtime/*Test.class"/>
- <include name="**/runtime/regexp/*Test.class"/>
- <include name="**/runtime/regexp/joni/*Test.class"/>
- <include name="**/framework/*Test.class"/>
- </fileset>
-
+ <!-- only to be invoked as dependency of "test" target -->
+ <target name="-test-classes-all" depends="jar" unless="test.class">
+ <fileset id="test.classes" dir="${build.test.classes.dir}">
+ <include name="**/api/javaaccess/*Test.class"/>
+ <include name="**/api/scripting/*Test.class"/>
+ <include name="**/codegen/*Test.class"/>
+ <include name="**/parser/*Test.class"/>
+ <include name="**/runtime/*Test.class"/>
+ <include name="**/runtime/regexp/*Test.class"/>
+ <include name="**/runtime/regexp/joni/*Test.class"/>
+ <include name="**/framework/*Test.class"/>
+ </fileset>
+ </target>
+
+ <!-- only to be invoked as dependency of "test" target -->
+ <target name="-test-classes-single" depends="jar" if="test.class">
+ <fileset id="test.classes" dir="${build.test.classes.dir}">
+ <include name="${test.class}*"/>
+ </fileset>
+ </target>
+
+ <!-- only to be invoked as dependency of "test" target -->
+ <target name="-test-nosecurity" unless="test.class">
<fileset id="test.nosecurity.classes" dir="${build.test.classes.dir}">
<include name="**/framework/ScriptTest.class"/>
</fileset>
-
- <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
+ <testng outputdir="${build.nosecurity.test.results.dir}" classfilesetref="test.nosecurity.classes"
verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
<jvmarg line="${ext.class.path}"/>
- <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
+ <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
<propertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ <propertyref prefix="nashorn."/>
+ </propertyset>
+ <propertyset>
+ <propertyref prefix="test-sys-prop-no-security."/>
+ <mapper from="test-sys-prop-no-security.*" to="*" type="glob"/>
</propertyset>
- <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
<classpath>
<pathelement path="${run.test.classpath}"/>
</classpath>
</testng>
- <testng outputdir="${build.nosecurity.test.results.dir}" classfilesetref="test.nosecurity.classes"
+ </target>
+
+ <!-- only to be invoked as dependency of "test" target -->
+ <target name="-test-security">
+ <delete dir="${build.dir}/nashorn_code_cache"/>
+ <property name="debug.test.jvmargs" value=""/>
+ <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
<jvmarg line="${ext.class.path}"/>
- <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
- <propertyset>
- <propertyref prefix="nashorn."/>
- </propertyset>
+ <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
+ <jvmarg line="${debug.test.jvmargs}"/>
<propertyset>
- <propertyref prefix="test-sys-prop-no-security."/>
- <mapper from="test-sys-prop-no-security.*" to="*" type="glob"/>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
</propertyset>
+ <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
<classpath>
<pathelement path="${run.test.classpath}"/>
</classpath>
</testng>
</target>
+ <target name="test" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file, -test-security, -test-nosecurity" if="testng.available"/>
+
<target name="test-basicparallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file">
<!-- use just build.test.classes.dir to avoid referring to TestNG -->
<java classname="${parallel.test.runner}" dir="${basedir}" classpath="${build.test.classes.dir}" failonerror="true" fork="true">
diff --git a/make/nbproject/ide-file-targets.xml b/make/nbproject/ide-file-targets.xml
index cb017bb2..00a06351 100644
--- a/make/nbproject/ide-file-targets.xml
+++ b/make/nbproject/ide-file-targets.xml
@@ -22,38 +22,14 @@
questions.
-->
<project basedir=".." name="nashorn-IDE">
- <property file="nbproject/nbjdk.properties"/>
- <property location="${netbeans.user}/build.properties" name="user.properties.file"/>
- <property file="${user.properties.file}"/>
- <import file="jdk.xml"/>
- <import file="${basedir}/build-init.xml"/>
- <!-- TODO: edit the following target according to your needs -->
- <!-- (more info: http://www.netbeans.org/kb/articles/freeform-config.html#runsingle) -->
- <target depends="-jdk-init, init" name="debug-selected-file-in-src">
- <fail unless="debug.class">Must set property 'debug.class'</fail>
- <ant antfile="build.xml" inheritall="false" target="jar"/>
+ <target name="debug-selected-file-in-src">
+ <fail unless="test.class">Must set property 'debug.class'</fail>
<nbjpdastart addressproperty="jpda.address" name="nashorn" transport="dt_socket">
<classpath path="${run.test.classpath}"/>
</nbjpdastart>
- <java classname="${debug.class}" fork="false">
- <classpath path="${run.test.classpath}"/>
- <jvmarg line="${boot.class.path}"/>
- <jvmarg value="-Xdebug"/>
- <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
- <jvmarg line="${run.test.jvmargs}"/>
- <arg value="${debug.class}"/>
- </java>
- </target>
- <!-- TODO: edit the following target according to your needs -->
- <!-- (more info: http://www.netbeans.org/kb/articles/freeform-config.html#runsingle) -->
- <target depends="-jdk-init, init" name="run-selected-file-in-src">
- <fail unless="run.class">Must set property 'run.class'</fail>
- <ant antfile="build.xml" inheritall="false" target="jar"/>
- <java classname="${run.class}" failonerror="true" fork="false">
- <classpath path="${run.test.classpath}"/>
- <jvmarg line="${boot.class.path}"/>
- <jvmarg line="${run.test.jvmargs}"/>
- <arg value="${run.class}"/>
- </java>
+ <ant antfile="build.xml" inheritall="false" target="test">
+ <property name="test.class" value="${test.class}"/>
+ <property name="debug.test.jvmargs" value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
+ </ant>
</target>
</project>
diff --git a/make/nbproject/project.xml b/make/nbproject/project.xml
index 828dc29d..2fcc6442 100644
--- a/make/nbproject/project.xml
+++ b/make/nbproject/project.xml
@@ -98,27 +98,27 @@
<script>nbproject/nbjdk.xml</script>
<target>debug-nb</target>
</action>
- <action name="debug.single">
- <script>nbproject/ide-file-targets.xml</script>
- <target>debug-selected-file-in-src</target>
+ <action name="run.single">
+ <script>build.xml</script>
+ <target>test</target>
<context>
- <property>debug.class</property>
- <folder>test/src</folder>
+ <property>test.class</property>
+ <folder>../test/src</folder>
<pattern>\.java$</pattern>
- <format>java-name</format>
+ <format>relative-path-noext</format>
<arity>
<one-file-only/>
</arity>
</context>
</action>
- <action name="run.single">
+ <action name="debug.single">
<script>nbproject/ide-file-targets.xml</script>
- <target>run-selected-file-in-src</target>
+ <target>debug-selected-file-in-src</target>
<context>
- <property>run.class</property>
- <folder>test/src</folder>
+ <property>test.class</property>
+ <folder>../test/src</folder>
<pattern>\.java$</pattern>
- <format>java-name</format>
+ <format>relative-path-noext</format>
<arity>
<one-file-only/>
</arity>