[Jython-checkins] jython: Add regrtest-file target to ant build.
jeff.allen
jython-checkins at python.org
Fri Oct 30 17:07:21 EDT 2015
https://hg.python.org/jython/rev/6e10b3ad1316
changeset: 7777:6e10b3ad1316
user: Jeff Allen <ja.py at farowl.co.uk>
date: Thu Oct 29 14:56:46 2015 +0000
summary:
Add regrtest-file target to ant build.
Target regrtest-file is like regrtest but reads the list of tests
from a file with fixed name "regr.tests". The motivation is to explore
why test results differ between ant regrtest and the prompt.
Some bugs in regrtest.py argument processing are fixed.
files:
Lib/test/regrtest.py | 4 +-
build.xml | 37 +++++++++++++++++++++++++++++--
2 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -217,11 +217,11 @@
try:
opts, args = getopt.getopt(sys.argv[1:], 'hvqxsSrf:lu:t:TD:NLR:wM:em:j:',
['help', 'verbose', 'quiet', 'exclude',
- 'single', 'slow', 'random', 'fromfile',
+ 'single', 'slow', 'random', 'fromfile=',
'findleaks', 'use=', 'threshold=', 'trace',
'coverdir=', 'nocoverdir', 'runleaks',
'huntrleaks=', 'verbose2', 'memlimit=',
- 'expected', 'memo'
+ 'expected', 'memo=', 'junit-xml='
])
except getopt.error, msg:
usage(2, msg)
diff --git a/build.xml b/build.xml
--- a/build.xml
+++ b/build.xml
@@ -137,7 +137,6 @@
<property name="junit.reports" value="${dist.dir}/testreports" />
<property name="junit.htmlreports" value="${dist.dir}/test-html-reports" />
-
<!-- classpaths -->
<path id="main.classpath">
<pathelement path="${extlibs.dir}/servlet-api-2.5.jar" />
@@ -469,9 +468,8 @@
</fileset>
</copy>
-->
+ </target>
- </target>
-
<target name="compile" depends="init,antlr_gen,brand-version">
<javac destdir="${compile.dir}"
target="${jdk.target.version}"
@@ -1064,6 +1062,39 @@
</exec>
</target>
+ <target name="regrtest-file"
+ depends="developer-build,regrtest-unix-file,regrtest-windows-file"
+ description="run Python tests specified in file regr.tests"/>
+
+ <target name="regrtest-unix-file" if="os.family.unix">
+ <exec executable="${dist.dir}/bin/jython">
+ <env key="JAVA_OPTS" value="-Duser.language=en -Duser.region=US"/>
+ <arg value="${dist.dir}/Lib/test/regrtest.py"/>
+ <arg value="--junit-xml"/>
+ <arg value="${junit.reports}"/>
+ <!-- <arg value="-v"/> -->
+ <arg value="--use"/>
+ <arg value="network,subprocess"/>
+ <!-- Only run the tests specified in the named file -->
+ <arg value="--fromfile"/>
+ <arg value="${jython.base.dir}/regr.tests"/>
+ </exec>
+ </target>
+
+ <target name="regrtest-windows-file" if="os.family.windows">
+ <exec executable="${dist.dir}/bin/jython.exe">
+ <arg value="${dist.dir}/Lib/test/regrtest.py"/>
+ <arg value="--junit-xml"/>
+ <arg value="${junit.reports}"/>
+ <!-- <arg value="-v"/> -->
+ <arg value="--use"/>
+ <arg value="network,subprocess"/>
+ <!-- Only run the tests specified in the named file -->
+ <arg value="--fromfile"/>
+ <arg value="${jython.base.dir}/regr.tests"/>
+ </exec>
+ </target>
+
<target name="regrtest-html-report" depends="init" description="generates HTML output out of regrtest JUnit XML">
<mkdir dir="${junit.htmlreports}/html"/>
<junitreport todir="${junit.htmlreports}">
--
Repository URL: https://hg.python.org/jython
More information about the Jython-checkins
mailing list