You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2009/07/18 19:53:53 UTC

svn commit: r795402 - in /harmony/enhanced/classlib/trunk/modules/crypto: build.xml make/run-test.xml

Author: hindessm
Date: Sat Jul 18 17:53:53 2009
New Revision: 795402

URL: http://svn.apache.org/viewvc?rev=795402&view=rev
Log:
Run crypto tests using hdk.

Added:
    harmony/enhanced/classlib/trunk/modules/crypto/make/run-test.xml   (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/crypto/build.xml

Modified: harmony/enhanced/classlib/trunk/modules/crypto/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/build.xml?rev=795402&r1=795401&r2=795402&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/build.xml Sat Jul 18 17:53:53 2009
@@ -43,8 +43,16 @@
     <property file="../../make/depends.properties" />
 
     <property name="tests.hdk.dir" value="${hy.hdk}/build/test/crypto" />
+    <property name="tests.excludes.hdk.dir" value="${tests.hdk.dir}/excludes" />
+    <property name="tests.resources.hdk.dir"
+              value="${tests.hdk.dir}/resources" />
     <property name="crypto.exclude.file"
               location="${tests.hdk.dir}/test.exclude" />
+    <fileset id="tests.support" dir="bin/test/support" />
+    <fileset id="tests.api" dir="bin/test/api" />
+    <fileset id="tests.api.boot" dir="bin/test/api.injected" />
+    <fileset id="tests.impl" dir="bin/test/impl" />
+    <fileset id="tests.impl.boot" dir="bin/test/impl.injected" />
 
     <target name="build" depends="compile-java, copy-resources, build-jar" />
 
@@ -60,11 +68,16 @@
     </target>
 
     <!-- internal target for local and global test run sequence -->
-    <target name="-test-module" depends="build, compile-tests, prepare-exclude, run-tests" />
+    <target name="-test-module" depends="build, run-tests" />
 
     <target name="clean">
         <delete file="${hy.jdk}/jre/lib/boot/crypto.jar" />
         <delete file="${hy.jdk}/jre/lib/boot/crypto-src.jar" />
+        <delete file="${tests.hdk.dir}/crypto_test_support.jar" />
+        <delete file="${tests.hdk.dir}/crypto_api_tests.jar" />
+        <delete file="${tests.hdk.dir}/crypto_api_boot_tests.jar" />
+        <delete file="${tests.hdk.dir}/crypto_impl_tests.jar" />
+        <delete file="${tests.hdk.dir}/crypto_impl_boot_tests.jar" />
         <delete failonerror="false">
             <fileset refid="classes" />
         </delete>
@@ -126,10 +139,70 @@
         </jar>
     </target>
 
+    <target name="test-jar" depends="svn-info,compile-tests">
+        <mkdir dir="${tests.hdk.dir}" />
+
+        <copy file="make/run-test.xml" tofile="${tests.hdk.dir}/build.xml" />
+
+        <jar destfile="${tests.hdk.dir}/crypto_test_support.jar">
+            <fileset refid="tests.support" />
+            <manifest>
+                <attribute name="Implementation-Version" value="${svn.info}"/> 
+            </manifest>
+            <metainf refid="hy.required.metainf-files"/>
+        </jar>
+
+        <jar destfile="${tests.hdk.dir}/crypto_api_tests.jar">
+            <fileset refid="tests.api" />
+            <manifest>
+                <attribute name="Implementation-Version" value="${svn.info}"/> 
+            </manifest>
+            <metainf refid="hy.required.metainf-files"/>
+        </jar>
+        <jar destfile="${tests.hdk.dir}/crypto_api_boot_tests.jar">
+            <fileset refid="tests.api.boot" />
+            <manifest>
+                <attribute name="Implementation-Version" value="${svn.info}"/> 
+            </manifest>
+            <metainf refid="hy.required.metainf-files"/>
+        </jar>
+
+        <jar destfile="${tests.hdk.dir}/crypto_impl_tests.jar">
+            <fileset refid="tests.impl" />
+            <manifest>
+                <attribute name="Implementation-Version" value="${svn.info}"/> 
+            </manifest>
+            <metainf refid="hy.required.metainf-files"/>
+        </jar>
+        <jar destfile="${tests.hdk.dir}/crypto_impl_boot_tests.jar">
+            <fileset refid="tests.impl.boot" />
+            <manifest>
+                <attribute name="Implementation-Version" value="${svn.info}"/> 
+            </manifest>
+            <metainf refid="hy.required.metainf-files"/>
+        </jar>
+
+        <mkdir dir="${tests.excludes.hdk.dir}" />
+        <copy todir="${tests.excludes.hdk.dir}">
+            <fileset dir="make" includes="exclude*"/>
+            <filterchain>
+                <tokenfilter>
+                    <replaceregex pattern="\.java" replace="\.class" flags="g"/>
+                </tokenfilter>
+            </filterchain>
+        </copy>
+
+        <copy todir="${tests.resources.hdk.dir}">
+            <fileset dir="src/test/resources" />
+        </copy>
+
+        <copy file="../../${junit.jar}" todir="${hy.hdk}/build/test" />
+    </target>
+
     <target name="compile-tests">
 
         <compile-tests description="crypto test support files"
-                       destdir="../../build/tests">
+                       destdir="bin/test/support">
             <javac-elements>
                 <src>
                     <pathelement location="src/test/support/common/java"/>
@@ -142,11 +215,14 @@
             </javac-elements>
         </compile-tests>
 
-
-        <compile-tests description="crypto api tests" destdir="bin/test/api">
+        <compile-tests description="crypto api tests"
+                       destdir="bin/test/api">
             <javac-elements>
                 <src path="src/test/api/java"/>
                 <include name="**/*Test.java" />
+                <classpath>
+                    <pathelement path="bin/test/support" />
+                </classpath>
             </javac-elements>
         </compile-tests>
 
@@ -155,6 +231,9 @@
             <javac-elements>
                 <src path="src/test/api/java.injected"/>
                 <include name="**/*Test.java" />
+                <classpath>
+                    <pathelement path="bin/test/support" />
+                </classpath>
             </javac-elements>
         </compile-tests>
 
@@ -166,156 +245,20 @@
             </javac-elements>
         </compile-tests>
 
-        <compile-tests description="crypto impl tests" destdir="bin/test/impl">
+        <compile-tests description="crypto impl tests"
+                       destdir="bin/test/impl">
             <javac-elements>
                 <src path="src/test/impl/java"/>
                 <include name="**/*Test.java" />
-            </javac-elements>
-        </compile-tests>
-    </target>
-
-    <target name="prepare-exclude">
-       <prepare-exclude-list moduleName="crypto" dir="./make"
-                             result="${crypto.exclude.file}"/>
-    </target>
-
-    <target name="run-tests" depends="run-tests-api, run-tests-impl" />
-
-    <target name="run-tests-api">
-
-        <run-tests description="api tests">
-            <junit-elements>
-
-                <classpath>
-                    <pathelement path="bin/test/api"/>
-                    <pathelement path="${hy.hdk}/build/test/support.jar" />
-                    <pathelement path="../../build/tests" />
-                </classpath>
-
-                <batchtest todir="${tests.output}" haltonfailure="no" >
-                    <fileset dir="src/test/api/java">
-                        <!-- if ${test.case}     -->
-                        <include name="${converted.tc}" if="test.case" />
-                        <!-- unless ${test.case} -->
-                        <include name="**/*Test.java" unless="test.case" />
-                        <excludesfile name="${crypto.exclude.file}" unless="test.case" />
-                    </fileset>
-                </batchtest>
-
-            </junit-elements>
-        </run-tests>
-
-        <run-tests description="api.injected tests">
-            <junit-elements>
-                <!-- to pick up junit.jar               -->
-                <jvmarg value="-Xbootclasspath/a:bin/test/api.injected${path.separator}../../${junit.jar}${path.separator}../../build/tests${path.separator}${hy.hdk}/build/test/support.jar"/>
-
-                <batchtest todir="${tests.output}" haltonfailure="no" >
-                    <fileset dir="src/test/api/java.injected">
-                        <!-- if ${test.case}     -->
-                        <include name="${converted.tc}" if="test.case" />
-                        <!-- unless ${test.case} -->
-                        <include name="**/*Test.java" unless="test.case" />
-                        <excludesfile name="${crypto.exclude.file}" unless="test.case" />
-                    </fileset>
-                </batchtest>
-
-            </junit-elements>
-        </run-tests>
-
-        <antcall target="touch-failures-file" />
-        <antcall target="touch-errors-file" />
-    </target>
-
-    <target name="run-tests-impl" unless="test.noimpl">
-        <run-tests description="impl tests">
-            <junit-elements>
                 <classpath>
-                    <pathelement path="bin/test/impl"/>
-                    <pathelement path="${hy.hdk}/build/test/support.jar" />
+                    <pathelement path="bin/test/support" />
                 </classpath>
-                
-                <batchtest todir="${tests.output}" haltonfailure="no" >
-                    <fileset dir="src/test/impl/java">
-                        <!-- if ${test.case}     -->
-                        <include name="${converted.tc}" if="test.case" />
-                        <!-- unless ${test.case} -->
-                        <include name="**/*Test.java" unless="test.case" />
-                        <excludesfile name="${crypto.exclude.file}" unless="test.case" />
-                    </fileset>
-                </batchtest>
-
-            </junit-elements>
-        </run-tests>
-
-        <run-tests description="impl injected tests">
-            <junit-elements>
-                <!-- to pick up junit.jar               -->
-                <jvmarg value="-Xbootclasspath/a:bin/test/impl.injected${path.separator}../../${junit.jar}${path.separator}../../build/tests"/>
-
-                <batchtest todir="${tests.output}" haltonfailure="no" >
-                    <fileset dir="src/test/impl/java.injected">
-                        <!-- if ${test.case}     -->
-                        <include name="${converted.tc}" if="test.case" />
-                        <!-- unless ${test.case} -->
-                        <include name="**/*Test.java" unless="test.case" />
-                        <excludesfile name="${crypto.exclude.file}" unless="test.case" />
-                    </fileset>
-                </batchtest>
-
-            </junit-elements>
-        </run-tests>
-
-        <antcall target="touch-failures-file" />
-        <antcall target="touch-errors-file" />
-    </target>
-
-    <target name="touch-failures-file" if="test.failures">
-        <echo file="${tests.output}/test.failures"
-            append="true">crypto${line.separator}</echo>
+            </javac-elements>
+        </compile-tests>
     </target>
 
-    <target name="touch-errors-file" if="test.errors">
-        <echo file="${tests.output}/test.errors"
-            append="true">crypto${line.separator}</echo>
+    <target name="run-tests" depends="test-jar">
+        <ant dir="${tests.hdk.dir}" target="test-module" />
     </target>
-    
-    <macrodef name="run-tests">
-        <attribute name="description" default="" />
-        <element name="junit-elements" />
-        <sequential>
-            <echo message="Running CRYPTO @{description}" />
-
-            <mkdir dir="${tests.output}" />
-
-            <property name="test.jre.home" value="${hy.jdk}/jre" />
-
-            <junit fork="yes"
-                   forkmode="${hy.test.forkmode}"
-                   timeout="${hy.test.timeout}"
-                   printsummary="withOutAndErr"
-                   errorproperty="test.errors"
-                   failureproperty="test.failures"
-                   showoutput="on"
-                   dir="${basedir}"
-                   jvm="${test.jre.home}/bin/java">
-
-                <assertions enableSystemAssertions="true">
-                    <enable />
-                </assertions>
-
-                <jvmarg line="${hy.test.vmargs}" />
-
-                <junit-elements />
-
-                <classpath>
-                    <pathelement path="src/test/resources"/>
-                    <pathelement path="../../build/tests" />
-                </classpath>
-
-                <formatter type="xml" />
-            </junit>
-        </sequential>
-    </macrodef>
 
 </project>

Added: harmony/enhanced/classlib/trunk/modules/crypto/make/run-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/make/run-test.xml?rev=795402&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/make/run-test.xml (added)
+++ harmony/enhanced/classlib/trunk/modules/crypto/make/run-test.xml Sat Jul 18 17:53:53 2009
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<project name="Harmony Crypto Test" default="test" basedir=".">
+
+    <property name="hy.hdk" location="../../.." />
+    <property name="test.jre.home" location="${hy.hdk}/jdk/jre" />
+    <property file="../test.properties" />
+    <import file="../../ant/properties.xml" />
+
+    <property name="work.dir" value=".." />
+    <property name="target.dir" value=".." />
+    <property name="tests.output" location="../report" />
+    <property name="junit.jar" location="../junit.jar" />
+
+    <target name="test" depends="test-module" />
+
+    <target name="test-module" depends="test-jre-vm-info">
+        <convert-test-as-class from="test.case" to="converted.tc.class" />
+        <run-hdk-tests module="crypto" jar="crypto_api_tests.jar">
+            <junit-elements>
+                <classpath>
+                    <pathelement path="crypto_test_support.jar" />
+                    <pathelement path="resources" />
+                </classpath>
+            </junit-elements>
+        </run-hdk-tests>
+        <run-hdk-tests module="crypto" jar="crypto_api_boot_tests.jar">
+            <junit-elements>
+                <jvmarg value="-Xbootclasspath/a:crypto_api_boot_tests.jar${path.separator}../junit.jar${path.separator}../support.jar${path.separator}crypto_test_support.jar"/>
+                <classpath>
+                    <pathelement path="resources" />
+                </classpath>
+            </junit-elements>
+        </run-hdk-tests>
+        <run-hdk-tests module="crypto" jar="crypto_impl_tests.jar">
+            <junit-elements>
+                <classpath>
+                    <pathelement path="crypto_test_support.jar" />
+                    <pathelement path="resources" />
+                </classpath>
+            </junit-elements>
+        </run-hdk-tests>
+        <run-hdk-tests module="crypto" jar="crypto_impl_boot_tests.jar">
+            <junit-elements>
+                <jvmarg value="-Xbootclasspath/a:crypto_impl_boot_tests.jar${path.separator}../junit.jar${path.separator}../support.jar"/>
+                <classpath>
+                    <pathelement path="resources" />
+                </classpath>
+            </junit-elements>
+        </run-hdk-tests>
+
+    </target>
+    
+</project>

Propchange: harmony/enhanced/classlib/trunk/modules/crypto/make/run-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native