You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mu...@apache.org on 2023/01/07 15:16:13 UTC
[xalan-test] branch master updated: committing build steps improvements for XalanJ 2.7.3 release. this seems to be now complete.
This is an automated email from the ASF dual-hosted git repository.
mukulg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/xalan-test.git
The following commit(s) were added to refs/heads/master by this push:
new f2e9f234 committing build steps improvements for XalanJ 2.7.3 release. this seems to be now complete.
f2e9f234 is described below
commit f2e9f234298a0ff416eb65a2a5ca81640ef3c5b7
Author: Mukul Gandhi <ga...@gmail.com>
AuthorDate: Sat Jan 7 20:45:57 2023 +0530
committing build steps improvements for XalanJ 2.7.3 release. this seems to be now complete.
---
build.bat | 147 ++++-----------------
build.xml | 60 ++++-----
.../xsltc_int_truncation_test.bat | 17 +--
3 files changed, 62 insertions(+), 162 deletions(-)
diff --git a/build.bat b/build.bat
index 634a5deb..195003bd 100755
--- a/build.bat
+++ b/build.bat
@@ -1,5 +1,4 @@
@echo off
-@goto start
rem
rem ==========================================================================
rem = Copyright 2001-2004 The Apache Software Foundation.
@@ -18,77 +17,36 @@ rem = limitations under the License.
rem ==========================================================================
rem
rem Name: build.bat
-rem Author: shane_curcuru@lotus.com
+rem Author: shane_curcuru@lotus.com,
+ ggregory@apache.org,
+ mukulg@apache.org
+
rem See: build.xml
-:usage
-@echo build.bat - compiles and executes Xalan Java-based test automation
-@echo Usage: test [target] [-Doption=value ...]
-@echo Example: test api -DtestClass=TransformerAPITest -Dqetest.loggingLevel=99
-@echo.
-@echo EITHER: set environment variable JARDIR to point to dir
-@echo containing *all* needed .jars to run, ...
-@echo ... OR: be in xml-xalan/test having built whatever .jars you
-@echo need in the normal locations, ...
-@echo ... OR: pass appropriate ANT_OPTS or the like to reset .jar
-@echo file locations to your locations
-@echo.
-@echo Note that even when JARDIR is set, normal .jar files may still be
-@echo on the end of the classpath; see build.xml for details
-@echo.
-@echo You should have set JAVA_HOME
-@echo You can set ANT_HOME if you use your own Ant install
+rem Setup:
+rem - you must set JAVA_HOME environment variable
+rem - you can set ANT_HOME environment variable if you use your own Ant install
-@echo You may set PARSER_JAR to specific path/filename.jar of parser
-@echo Note: PARSER_JAR is ignored when JARDIR is set
-@echo You may set JAVA_OPTS to be passed to java program
-@echo All other command line opts are passed to Ant
-@echo.
-@echo build -projecthelp will show you Ant help and build targets
-@echo.
+echo.
+echo Xalan-J test automation build
+echo -----------------------------
-goto mainEnd
-rem ------------------------------------------------------------------------
-rem Blatantly modeled on ant.bat
-:start
-rem Check for help requests
-if '%1' == '' goto usage
-if '%1' == '-h' goto usage
-if '%1' == '-H' goto usage
-if '%1' == '-?' goto usage
-@echo %0 beginning...
+if "%JAVA_HOME%"=="" goto noJavaHome
-if not "%OS%"=="Windows_NT" goto win9xStart
-:winNTStart
-@setlocal
+if exist "%JAVA_HOME%\lib\tools.jar" (
+ set _CLASSPATH=%JAVA_HOME%\lib\tools.jar
+)
-set classpath=..\java\tools\ant.jar;..\java\lib\xercesImpl.jar;..\java\lib\xalan.jar;..\java\lib\serializer.jar;..\java\lib\xml-apis.jar;%CLASSPATH%
+set _JAVACMD=%JAVA_HOME%\bin\java
-rem On NT/2K grab all arguments at once
+rem On windows grab all arguments at once
set ANT_CMD_LINE_ARGS=%*
-goto doneStart
-
-:win9xStart
-rem Slurp the command line arguments. This loop allows for an unlimited number of
-rem agruments (up to the command line limit, anyway).
-
-set ANT_CMD_LINE_ARGS=
-
-:setupArgs
-if "%1" == "" goto doneStart
-set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
-shift
-goto setupArgs
-
-:doneStart
-rem This label provides a place for the argument list loop to break out
-rem and for NT handling to skip to.
rem Default ANT_HOME to the one what user has set
if not "%ANT_HOME%"=="" set _ANT_HOME=%ANT_HOME%
if "%ANT_HOME%"=="" set _ANT_HOME=..\xalan-java
-if EXIST "%_ANT_HOME%\tools\ant.jar" (
+if exist "%_ANT_HOME%\tools\ant.jar" (
set _ANT_JARS=%_ANT_HOME%\tools\ant.jar
) else if EXIST "%_ANT_HOME%\..\tools\ant.jar" (
set _ANT_JARS=%_ANT_HOME%\..\tools\ant.jar
@@ -96,76 +54,19 @@ if EXIST "%_ANT_HOME%\tools\ant.jar" (
set _ANT_JARS=%_ANT_HOME%\lib\ant.jar;%_ANT_HOME%\lib\ant-launcher.jar
)
-rem Patch for Ant limitation:
-rem <property environment="xxx" /> is only available on certain platforms.
-rem Apparently Windows 2003 is not one of the supported platforms.
-rem A workaround (according to Ant's FAQ) is to set the os.name=Windows_NT
-rem before calling Ant.
-rem Since this is a Windows batch file and I don't think Xalan's test
-rem harness or targets care which Windows version we're running on, its
-rem probably safe to use this workaround.
-set _ANT_OPTS=%ANT_OPTS% -Dos.name=Windows_NT
-
-rem Note: classpath handling is special for testing Xalan
-rem If PARSER_JAR blank, default to xerces in the xalan dir
-if "%PARSER_JAR%" == "" set _PARSER_JAR=..\java\lib\xercesImpl.jar
-if not "%PARSER_JAR%" == "" set _PARSER_JAR=%PARSER_JAR%
-set _XML-APIS_JAR=%XML-APIS_JAR%
-if "%_XML-APIS_JAR%" == "" set _XML-APIS_JAR=..\java\lib\xml-apis.jar
-
-rem If JARDIR is blank, then only add Ant, PARSER_JAR, and XML-APIS_JAR to the
-rem classpath before running Ant - then within the Ant file, it
-rem will add other .jars from default locations
-if "%JARDIR%" == "" set _CLASSPATH=%CLASSPATH%;%_ANT_JARS%;%_XML-APIS_JAR%;%_PARSER_JAR%
-
-rem Else if JARDIR is set, then put all Xalan-J 2.x required .jar files
-rem in the classpath first from that one dir
-rem Note: Does not yet support xsltc testing! TBD -sc
-rem [XalanJ Team] Note: Since XalanJ 2.7.3 release, xsltc testing is supported
-rem Note: Does not yet support using crimson from JARDIR (forces xercesImpl.jar)! TBD -sc
-if not "%JARDIR%" == "" set _CLASSPATH=%JARDIR%\xml-apis.jar;%JARDIR%\xercesImpl.jar;%JARDIR%\xalan.jar;%JARDIR%\serializer.jar;%JARDIR%\testxsl.jar;%JARDIR%\bsf.jar;%JARDIR%\commons-logging-1.2.jar;%JARDIR%\regexp.jar;%JARDIR%\rhino-1.7.14.jar;%JARDIR%\Tidy.jar;%_ANT_JARS%;%CLASSPATH%
-
-rem Attempt to automatically add system classes to very end of _CLASSPATH
-if exist "%JAVA_HOME%\lib\tools.jar" set _CLASSPATH=%_CLASSPATH%;%JAVA_HOME%\lib\tools.jar
-if exist "%JAVA_HOME%\lib\classes.zip" set _CLASSPATH=%_CLASSPATH%;%JAVA_HOME%\lib\classes.zip
-
+set _CLASSPATH=%_CLASSPATH%;%_ANT_JARS%
-if "%JAVA_HOME%" == "" goto noJavaHome
-if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java
-goto checkJikes
-
-:noJavaHome
-if "%_JAVACMD%" == "" set _JAVACMD=java
-echo.
-echo Warning: you should set JAVA_HOME and add tools.jar/classes.zip to your CLASSPATH!.
-echo.
-
-:checkJikes
-rem also pass along the selected parser to Ant
-rem Note: we don't need to do this for xml-apis.jar
-set _ANT_OPTS=%_ANT_OPTS% -Dparserjar=%_PARSER_JAR%
-if not "%JIKESPATH%" == "" goto runAntWithJikes
+@echo on
+"%_JAVACMD%" -mx1024m -classpath "%_CLASSPATH%" org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
+@echo off
-:runAnt
-"%_JAVACMD%" %JAVA_OPTS% -classpath "%_CLASSPATH%" -Dant.home="%_ANT_HOME%" %_ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
goto end
-:runAntWithJikes
-"%_JAVACMD%" %JAVA_OPTS% -classpath "%_CLASSPATH%" -Dant.home="%_ANT_HOME%" -Djikes.class.path=%JIKESPATH% %_ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
+:noJavaHome
+echo Warning: JAVA_HOME environment variable is not set
:end
set _CLASSPATH=
set _ANT_HOME=
-set _ANT_OPTS=
set _JAVACMD=
-set _PARSER_JAR=
-set _XML-APIS_JAR=
-set ANT_CMD_LINE_ARGS=
-
-if not "%OS%"=="Windows_NT" goto mainEnd
-:winNTend
-@endlocal
-
-:mainEnd
-@echo %0 completed!
-
+set _ANT_JARS=
\ No newline at end of file
diff --git a/build.xml b/build.xml
index f432a160..a8e3f50f 100644
--- a/build.xml
+++ b/build.xml
@@ -60,7 +60,7 @@ dependencies - users must manually 'build jar' first.
-->
<property environment="ENV" />
- <property name="year" value="2000-2022"/>
+ <property name="year" value="2000-2023"/>
<!-- Properties related to compiling the tests -->
<property name="build.compiler" value="classic"/>
<property name="compiler" value="${build.compiler}"/>
@@ -75,9 +75,10 @@ dependencies - users must manually 'build jar' first.
<property name="test.build.docs" value="${test.build.dir}/docs"/>
<property name="test.build.apidocs" value="${test.build.docs}/apidocs"/>
<property name="tests.bugzilla.dir" value="tests/bugzilla"/>
- <property name="tests.bugzilla.build.dir" value="tests/bugzilla/build"/>
- <property name="tests.extensions.dir" value="${extensions.inputDir}/java"/>
- <property name="tests.extensions.build.dir" value="${extensions.inputDir}/java/build"/>
+ <property name="tests.bugzilla.build.dir" value="${tests.bugzilla.dir}/build"/>
+ <property name="extensions.dir" value="tests/extensions"/>
+ <property name="tests.extensions.dir" value="${extensions.dir}/java"/>
+ <property name="tests.extensions.build.dir" value="${extensions.dir}/java/build"/>
<!-- Names/locations of .jar files we build -->
@@ -97,12 +98,11 @@ dependencies - users must manually 'build jar' first.
<!-- Various names/locations of dependent jars -->
<property name="xalan.jar" value="${xalan.build.dir}/xalan.jar"/>
<property name="xalan.unbundled.jar"
- value="${xalan.build.dir}/xalan-unbundled.jar"/>
+ value="${xalan.build.dir}/xalan-unbundled.jar"/>
<property name="xsltc.jar" value="${xalan.build.dir}/xsltc.jar"/>
<property name="ser.jar" value="${xalan.build.dir}/serializer.jar"/>
<property name="xml-apis.jar" value="${xalan.lib.dir}/xml-apis.jar"/>
<property name="parserjar" value="${xalan.lib.dir}/xercesImpl.jar"/>
- <!--<property name="bcel.jar" value="${xalan.lib.dir}/BCEL.jar"/>-->
<!-- JTidy is used by the XSLTC comparator -->
<property name="jtidy.jar" value="${test.tools.dir}/Tidy.jar"/>
@@ -135,7 +135,6 @@ dependencies - users must manually 'build jar' first.
<pathelement location="${ser.jar}" />
<pathelement location="${xml-apis.jar}" />
<pathelement location="${parserjar}" />
- <pathelement path="${java.class.path}" />
</path>
<!-- Note: given that many of the tests interact with xerces and
@@ -157,7 +156,6 @@ dependencies - users must manually 'build jar' first.
<!-- ================================================================== -->
<!-- Classpath used when compiling tests -->
<path id="compiletest.class.path">
- <pathelement path="${java.class.path}" />
<pathelement location="${xalan.jar}" />
<pathelement location="${xsltc.jar}" /> <!-- add this so we can test the
separate jar distribution -->
@@ -169,7 +167,6 @@ dependencies - users must manually 'build jar' first.
<!-- Classpath used when running API tests -->
<path id="api.class.path">
- <pathelement path="${java.class.path}" />
<pathelement location="${xalan.jar}" />
<pathelement location="${ser.jar}" />
<pathelement location="${xml-apis.jar}" />
@@ -177,10 +174,13 @@ dependencies - users must manually 'build jar' first.
<pathelement location="${testxsl.jar}" />
<pathelement location="${jtidy.jar}" />
</path>
+
+ <path id="testxsl.class.path">
+ <pathelement location="${testxsl.jar}" />
+ </path>
<!-- Classpath used when running conf or conformance tests -->
<path id="conf.class.path">
- <pathelement path="${java.class.path}" />
<pathelement location="${xalan.jar}" />
<pathelement location="${ser.jar}" />
<pathelement location="${xml-apis.jar}" />
@@ -189,17 +189,15 @@ dependencies - users must manually 'build jar' first.
<pathelement location="${jtidy.jar}" />
</path>
- <!-- Boot class path for JDK 1.4. Order is important to ensure
- GUMP builds work correctly, and people who don't use the
- build.bat/build.sh can still build on JDK 1.4 as normal. -->
+ <!-- Boot class path for JDK 1.4+ -->
<path id="boot.class.path">
- <pathelement location="${xalan.jar}" />
- <pathelement location="${xsltc.jar}" /> <!-- add this so we can test the
+ <!--<pathelement location="${xalan.jar}" />
+ <pathelement location="${xsltc.jar}" />--> <!-- add this so we can test the
separate jar distribution -->
- <pathelement location="${ser.jar}" />
- <pathelement location="${java.class.path}" />
+ <pathelement location="${ser.jar}" />
<pathelement location="${xml-apis.jar}" />
<pathelement location="${parserjar}" />
+ <pathelement path="${sun.boot.class.path}" />
</path>
<!-- Gump build xml-xalan2-smoketest should use xalan.unbundled.jar -->
@@ -230,11 +228,14 @@ dependencies - users must manually 'build jar' first.
<!-- Classpath used when running extensions tests -->
<path id="extensions.class.path">
- <path refid="api.class.path" />
- <pathelement location="${bsf.jar}" />
+ <pathelement location="${xalan.jar}" />
+ <path refid="testxsl.class.path" />
<pathelement location="${commons-logging.jar}" />
+ <pathelement location="${bsf.jar}" />
<pathelement location="${js.jar}" />
+ <pathelement location="${jtidy.jar}" />
<pathelement location="${tests.extensions.build.dir}" />
+ <pathelement location="${tests.bugzilla.build.dir}" />
<!-- Add more pathelements if we add more Java extensions dirs -->
</path>
@@ -249,7 +250,6 @@ dependencies - users must manually 'build jar' first.
<!-- ================================================================== -->
<taskdef name="xalantest" classname="org.apache.qetest.xsl.XSLTestAntTask">
<classpath>
- <pathelement path="${java.class.path}" />
<!-- Needed so this build file can run: this refers to
a precompiled version of XSLTestAntTask.class that
is checked in: normally at runtime, it should come
@@ -323,7 +323,7 @@ dependencies - users must manually 'build jar' first.
</target>
<target name="run.xalan-extension-test" >
- <antcall target="run.xalan-extension-test.gump"/>
+ <!--<antcall target="run.xalan-extension-test.gump"/>-->
<antcall target="run.xalan-extension-test.normal"/>
</target>
@@ -339,7 +339,7 @@ dependencies - users must manually 'build jar' first.
</xalantest>
</target>
- <target name="run.xalan-extension-test.normal" unless="gump">
+ <target name="run.xalan-extension-test.normal">
<xalantest test="${testClass}"
testType="${testType}"
classpathref="${xalantest.classpathref}"
@@ -365,7 +365,7 @@ dependencies - users must manually 'build jar' first.
<!-- Note this is case-sensitive, even on Windows! -->
<!-- Note JARDIR support should probably be removed, since it's a maintenance hassle Jul-02 -sc -->
<echo message="Your ==JARDIR== is set to ==${ENV.JARDIR}==" />
- <echo message="JVM Classpath is ${java.class.path}" />
+ <!--<echo message="JVM Classpath is ${java.class.path}" />-->
<mkdir dir="${test.build.dir}" />
<mkdir dir="${test.build.dir}/${test.root}" />
<!-- Also copy over precompiled external processor wrapper classes -->
@@ -633,9 +633,9 @@ dependencies - users must manually 'build jar' first.
<!-- ================================================================== -->
<target name="extensions"
description="Run extensions tests.
- Non-Java extensions will use the Jakarta BSF implementation."
+ Non-Java extensions will use the Apache BSF implementation."
depends="init.test">
- <echo message="Executing Xalan extensions tests. Non-Java extensions will use the Jakarta BSF implementation." />
+ <echo message="Executing Xalan extensions tests. Non-Java extensions will use the Apache BSF implementation." />
<!-- Set the default conformance test driver, user may
override; note test.properties:extensions.testlet=
-->
@@ -1246,7 +1246,7 @@ dependencies - users must manually 'build jar' first.
description="Compile base qetest files; no Xalan dependencies">
<javac srcdir="${test.src.dir}"
destdir="${test.build.dir}"
- includes="${test.root}*.java"
+ includes="${test.root}*.java"
debug="${debug}" />
</target>
@@ -1255,7 +1255,7 @@ dependencies - users must manually 'build jar' first.
description="Jar base qetest files; no Xalan dependencies">
<jar jarfile="${qetest.jar}"
basedir="${test.build.dir}"
- includes="${test.root}*.java,${test.root}*.properties" />
+ includes="${test.root}*.java,${test.root}*.properties"/>
</target>
@@ -1274,7 +1274,7 @@ dependencies - users must manually 'build jar' first.
<javac srcdir="${test.src.dir}"
destdir="${test.build.dir}"
includes="${test.root}xsl/*.java"
- debug="${debug}"
+ debug="${debug}"
classpathref="compiletest.class.path" />
</target>
@@ -1352,7 +1352,7 @@ dependencies - users must manually 'build jar' first.
destdir="${tests.bugzilla.build.dir}"
debug="${debug}"
excludes="Bugzilla1288.java"
- classpathref="bugzilla.class.path" />
+ classpath="${xalan.jar}:${testxsl.jar}" />
</target>
<target name="extensions.classes" depends="jar"
@@ -1559,7 +1559,6 @@ dependencies - users must manually 'build jar' first.
-->
<path id="xsltc.runtime.class.path">
- <pathelement path="${java.class.path}" />
<pathelement location="${xalan.build.dir}/xalan.jar" />
<!-- add xsltc.jar so we can test the separate jar distribution -->
@@ -1572,7 +1571,6 @@ dependencies - users must manually 'build jar' first.
<pathelement location="${jtidy.jar}" />
</path>
<path id="xsltc.compile.class.path">
- <pathelement path="${java.class.path}" />
<pathelement location="${xalan.build.dir}/xalan.jar" />
<!-- add xsltc.jar so we can test the separate jar distribution -->
diff --git a/tests/xsltc_integer_truncation/xsltc_int_truncation_test.bat b/tests/xsltc_integer_truncation/xsltc_int_truncation_test.bat
index 3debb62d..b1ebcbdc 100644
--- a/tests/xsltc_integer_truncation/xsltc_int_truncation_test.bat
+++ b/tests/xsltc_integer_truncation/xsltc_int_truncation_test.bat
@@ -2,20 +2,21 @@
REM "Testing XalanJ integer truncation bug fix, when using XSLTC"
-REM Set JAVA_HOME environment variable, for the local environment
+REM Set JAVA_HOME environment variable, for the local environment
-REM Set JARDIR environment variable, for the local environment.
-REM For the definition of, JARDIR environment variable, please see
-REM the document https://gitbox.apache.org/repos/asf?p=xalan-java.git;a=blob_plain;f=README;hb=refs/heads/xalan-j_2_7_1_maint.
+set XALAN_BUILD_DIR_PATH=..\..\xalan-java\build;..\..\build
-if EXIST "test1.class" (
+set XERCES_ENDORSED_DIR_PATH=..\..\xalan-java\lib\endorsed;..\..\lib\endorsed
+
+if exist "test1.class" (
REM clear the result XalanJ translet file, if that exists
- DEL test1.class
+ del test1.class
)
-%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%JARDIR% org.apache.xalan.xslt.Process -XSLTC -IN test1.xml -XSL test1.xsl -SECURE -XX -XT 2>NUL
+REM in the future, we'll try to run this test as an API test
+%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XALAN_BUILD_DIR_PATH%;%XERCES_ENDORSED_DIR_PATH% org.apache.xalan.xslt.Process -XSLTC -IN test1.xml -XSL test1.xsl -SECURE -XX -XT 2>NUL
-if EXIST "test1.class" (
+if exist "test1.class" (
echo Test failed. Please solve this, before checking in!
) else (
echo CONGRATULATIONS! The test passed!
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org