harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r531732 [2/2] - in /harmony/enhanced/buildtest/branches: ./ 2.0/ 2.0/adaptors/ 2.0/adaptors/classlib/ 2.0/adaptors/drlvm/ 2.0/scripts/ 2.0/scripts/templates/
Date Tue, 24 Apr 2007 05:30:56 GMT
Added: harmony/enhanced/buildtest/branches/2.0/scripts/exec-adaptor.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/exec-adaptor.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/exec-adaptor.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/exec-adaptor.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,80 @@
+<?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. -->
+
+<!DOCTYPE buildtest SYSTEM "../buildtest.dtd">
+
+<!-- ====================================================================== 
+               BT Framework Implementation of Adaptors Execution 
+     ====================================================================== -->
+<project name="exec-adaptor" default="call" basedir=".">
+
+    <import file="${framework.implementation.file}"/>
+    <import file="${adaptors.dir}/${suite.name}/adaptor.xml"/>
+
+    <!-- calls the adaptor's target specified by 
+         '@{target}' attribute value.
+         Supposed parameters:
+             ${suite.name} - the name of the suite to call
+             @{target}     - the target of the adaptor to launch
+             ${result.file.location} - the location of the file for
+                    storing of the resulting parameters values
+         It's supposed that all of the properties needed to be known
+         by Test Suite are already defined and passed to this call
+         with Ant's environment.
+         -->
+    <macrodef name="call-target">
+        <attribute name="target"/>
+        <sequential>
+            <trycatch property="execution.exception">
+            <try>
+                <runtarget target="@{target}"/>
+            </try>
+            <catch>
+                <echo>
+--------
+WARNING: Target @{target} of adaptor for Test Suite '${suite.name}' FAILED
+-------- with the following exception:
+${execution.exception}
+</echo>
+                <property name="${suite.name}.parameters.@{target}.failed" value="true"/>
+            </catch>
+            </trycatch>
+            <resolve-parameters suite="${suite.name}" file="${result.file.location}"/>
+            <save-parameters suite="${suite.name}" file="${result.file.location}"/>
+        </sequential>
+    </macrodef>
+
+    <target name="setup-suite">
+        <call-target target="setup"/>
+    </target>
+
+    <target name="run-suite">
+        <call-target target="run"/>
+    </target>
+
+    <!-- just load all defined parameters -->
+    <target name="import-suite">
+        <xmlproperty file="parameters.xml"
+                     collapseAttributes="true"
+                     semanticAttributes="true"
+                     prefix="${suite.name}"
+        />
+        <save-parameters suite="${suite.name}" file="${result.file.location}"/>
+    </target>
+
+</project>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/exec-adaptor.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties Mon Apr 23 22:30:55 2007
@@ -0,0 +1,25 @@
+build.dir=${root.dir}/build
+test.sources.dir=${root.dir}/tests
+
+required.parameters.location=${root.dir}/required-parameters.properties
+backup.parameters.location=${root.dir}/backup-parameters.properties
+
+external.libs.dir=${build.dir}/libs
+external.arch.dir=${build.dir}/arch
+temp.files.dir=${build.dir}/temp
+checkouts.dir=${build.dir}/checkouts
+results.dir=${build.dir}/results
+classes.dir=${build.dir}/classes
+
+execution.timeout=10000
+
+cc.work.dir=${build.dir}/cc
+cc.config.file=${cc.work.dir}/cc-config.xml
+cc.config.template=${scripts.dir}/templates/cc-config-template.xml
+cc.project.template=${scripts.dir}/templates/cc-project-template.xml
+cc.log.dir=${cc.work.dir}/logs
+cc.project.execution.timeout=5000000
+
+local.configuration.file=${root.dir}/framework.local.properties
+local.configuration.template.file=${scripts.dir}/local.properties.template
+

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,835 @@
+<?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. -->
+
+<!DOCTYPE buildtest SYSTEM "../buildtest.dtd">
+
+<!-- ====================================================================== 
+                   BT Framework Implementation Specific Code 
+     ====================================================================== 
+     Defines the following ids on the objects:
+        <propertyset id="parameters.id">
+            set of all of the parameters with keys in extended form
+            (${suite.name}.parameters.*)
+
+        <propertyset id="resolved.external.parameters.id">
+            names of resolved externals (ext.*)
+        
+        <propertyset id="required.parameters.id">
+            set of all of the required parameters with keys in extended form
+            (${suite.name}.parameters.required.${required.parameter.name})
+        
+        <propertyset id="required.parameters.simple.id">
+            set of all of the required parameters with keys in simple form
+            (${suite.name}.${required.parameter.name})
+
+        <propertyset id="shared.parameters.id">
+            set of all of the shared parameters with keys in extended form
+
+        <propertyset id="shared.parameters.simple.id">
+            set of all of the shared parameters with keys in simple form 
+
+        <propertyset id="@{suite}.parameters.id">
+            set of all of the parameters needed to be known by @{suite}
+
+-->
+<project name="framework-implementation" default="run" basedir=".">
+
+    <import file="download.xml"/>
+    <import file="cc-project.xml"/>
+
+    <!-- check framework parameters passed to adaptors -->
+    <target name="check-framework-parameters">
+        <check-file-pointer property="build.dir" type="dir"/>
+        <check-file-pointer property="checkouts.dir" type="dir"/>
+    </target>
+
+    <!-- Sets up the framework -->
+    <target name="init-framework" 
+            depends="define-tasks, make-dirs, patch-ant, reorder-suites, load-parameters,
+                        fetch-depends,
+                            -delete-temporal-properties"/>
+
+    <!-- Fixes Ant's Bug described at: 
+         http://issues.apache.org/bugzilla/show_bug.cgi?id=30569
+        -->
+    <target name="patch-ant" depends="make-dirs, define-tasks">
+        <if>
+            <not><available file="${temp.files.dir}/SubAnt.java"/></not>
+        <then>
+            <get src="http://issues.apache.org/bugzilla/attachment.cgi?id=15681"
+                 dest="${temp.files.dir}/SubAnt.java"
+                 usetimestamp="true"
+                 verbose="true"
+            />
+        </then>
+        </if>
+        <javac 
+            srcdir="${temp.files.dir}"
+            destdir="${classes.dir}"
+            includesfile="${temp.files.dir}/SubAnt.java">
+            <depend targetdir="${classes.dir}/org/apache/tools/ant/taskdefs">
+                <mapper>
+                    <globmapper from="*.java" to="*.class"/>
+                </mapper>
+            </depend>
+        </javac>
+    </target>
+
+    <target name="make-dirs">
+        <!-- Make Dirs -->
+        <mkdir dir="${build.dir}"/>
+        <mkdir dir="${checkouts.dir}"/>
+        <mkdir dir="${results.dir}"/>
+        <mkdir dir="${temp.files.dir}"/>
+        <mkdir dir="${classes.dir}"/>
+    </target>
+
+    <target name="define-tasks" depends="fetch-ant-contrib, define-ant-contrib"/>
+
+    <target name="define-ant-contrib">
+        <!-- plug in the ANTCONTRIB -->
+        <taskdef resource="net/sf/antcontrib/antlib.xml">
+            <classpath>
+                <pathelement location="${ext.ant-contrib.location}" />
+            </classpath>
+        </taskdef>
+    </target>
+
+    <target name="load-suites-parameters" depends="define-tasks, define-suites-ids">
+        <!-- load suites properties -->
+        <for list="${test.suites.names.list}" param="suite">
+            <sequential>
+                <log message="Load Parameters For '@{suite}'"/>
+                <call-to-adaptor suite="@{suite}" call="import-suite"/>
+            </sequential>
+        </for>
+    </target>
+
+    <target name="load-framework-parameters">
+        <!-- load framework parameters file containing 
+                       external libraries descriptions -->
+        <xmlproperty 
+            file="${scripts.dir}/parameters.xml"
+            collapseAttributes="true" 
+            semanticAttributes="true"
+            prefix="framework"
+        />
+    </target>
+
+    <target name="load-parameters"
+            depends="load-framework-parameters, load-suites-parameters, 
+                        define-tasks">
+        <log message="Loaded Parameters:"/>
+        <print-parameters/>
+
+        <!-- all parameters with keys in extended form -->
+        <propertyset id="parameters.id">
+            <propertyref regex="[^.][^.]*\.parameters\."/>
+        </propertyset>
+
+        <!-- all parameters defined for framework -->
+        <propertyset id="framework.parameters.id">
+            <propertyref regex="framework\.parameters\."/>
+        </propertyset>
+
+        <!-- required parameters with keys in extended form -->
+        <propertyset id="required.parameters.id">
+            <propertyref regex="[^.][^.]*\.parameters\.required"/>
+        </propertyset>
+
+        <!-- required parameters with keys in simple form -->
+        <propertyset id="required.parameters.simple.id">
+            <propertyref regex="[^.][^.]*\.parameters\.required"/>
+            <regexpmapper from="^([^.][^.]*)\.parameters\.required\.(.*)$" to="\1.\2"/>
+        </propertyset>
+
+        <!-- shared parameters with keys in extended form -->
+        <propertyset id="shared.parameters.id">
+            <propertyref regex="[^.][^.]*\.parameters\.shared"/>
+        </propertyset>
+
+        <!-- shared parameters with keys in simple form -->
+        <propertyset id="shared.parameters.simple.id">
+            <propertyref regex="[^.][^.]*\.parameters\.shared"/>
+            <regexpmapper from="^([^.][^.]*)\.parameters\.shared\.(.*)$" to="\1.\2"/>
+        </propertyset>
+
+        <!-- resolved externals -->
+        <propertyset id="resolved.external.parameters.id">
+            <propertyref prefix="ext."/>
+        </propertyset>
+    </target>
+
+    <target name="process-required-parameters" depends="load-parameters">
+        <!-- Load and define (as extended) preset required parameters -->
+        <property file="${required.parameters.location}" prefix="tmp.required.preset"/>
+        <!-- XXX echoproperties>
+            <propertyset>
+                <propertyref prefix="tmp.required.preset"/>
+            </propertyset>
+        </echoproperties -->
+        <property name="tmp.preset.required.params.list" value=""/>
+        <propertyselector 
+            property="tmp.preset.required.params.list"
+            override="true"
+            delimiter=","
+            match="^tmp\.required\.preset\.(.*)$"
+            select="\1"
+            distinct="true"
+        />
+        <log message="Preset Required Parameters: ${tmp.preset.required.params.list}"/>
+        <!-- Set up Required Parameter values and remove possible trash 
+             properties got from the file (local configuration properties put
+             into the wrong place (${local.configuration.file} should be used
+             instead of ${required.parameters.location}) 
+             or required parameters of unsellected suites) -->
+        <for list="${tmp.preset.required.params.list}" param="preset">
+            <sequential>
+                <var name="tmp.param.key" unset="true"/>
+                <property name="tmp.param.key" value=""/>
+                <!-- bring the parameter key to the extended form -->
+                <propertyregex
+                    property="tmp.param.key" 
+                    input="@{preset}"
+                    regexp="^([^.][^.]*)\.(.*)$"
+                    replace="\1.parameters.required.\2"
+                    override="true"
+                />
+                <var name="tmp.param.value" unset="true"/>
+                <property name="tmp.param.value" 
+                          value="${tmp.required.preset.@{preset}}"/>
+                <!-- log message="Processing: ${tmp.param.key} = ${tmp.param.value} (${tmp.required.preset.@{preset}})"/ -->
+                <if>
+                    <not><isset property="${tmp.param.key}.description"/></not>
+                <then>
+                    <echo>
+--------
+WARNING: Property
+--------    @{preset}=${tmp.param.value}
+specified in 
+            ${required.parameters.location}
+file was not described as 'required' for any of selected test suites:
+            ${test.suites.names.list}
+It is removed from required properties settings file 
+and it's backed up into
+            ${backup.parameters.location}
+file.
+</echo>
+                    <echo file="${backup.parameters.location}" append="true">
+@{preset}=${tmp.param.value}</echo>
+                </then>
+                <else>
+                    <if>
+                        <!-- check that the value is set -->
+                        <length string="${tmp.param.value}" 
+                                when="greater" length="0"/>
+                    <then>
+                        <!-- value is set, so use it -->
+                        <var name="${tmp.param.key}" 
+                             value="${tmp.param.value}"/>
+                    </then>
+                    </if>
+                </else>
+                </if>
+            </sequential>
+        </for>
+
+        <antcall target="update-required-parameters-file" inheritAll="true">
+            <propertyset>
+                <propertyset refid="required.parameters.simple.id"/>
+                <globmapper from="*" to="R-EQUIRED.*"/>
+            </propertyset>
+        </antcall>
+    </target>
+
+    <!-- Updates the file containing all of the required properties -->
+    <!-- This target should be called with propertyset containing all the
+         required parameter properties with names prefixed with 
+         "required." -->
+    <target name="update-required-parameters-file">
+        <property name="tmp.required.parameters.list" value=""/>
+        <propertyselector 
+            property="tmp.required.parameters.list"
+            override="true"
+            delimiter=","
+            match="^R-EQUIRED\.(.*?)(?:\.description)?$"
+            select="\1"
+            distinct="true"
+        />
+        <sortlist 
+            property="tmp.required.parameters.sorted.list"
+            value="${tmp.required.parameters.list}"
+            delimiter=","
+            override="true"
+        />
+        <echo file="${required.parameters.location}">#
+# Required Parameters Settings File
+#
+# Please, provide the values for all of the 
+# required unset parameters described here.
+#
+# This file was generated on the base of parameters
+# described as 'required' by selected test suites (${test.suites.names.list})
+#
+# The other configuration properties (not described as 'required'
+# by any of the selected test suites) should not be added to this file.
+# They should be specified in
+#    ${local.configuration.file} 
+# file.
+#
+# If there is a property not considered as 'required' it will be 
+# removed from this file and backed up into
+#    ${backup.parameters.location}
+# file.
+#
+
+</echo>
+        <for list="${tmp.required.parameters.sorted.list}" param="required" trim="yes">
+            <sequential>
+
+                <log message="Precessing of @{required} = ${R-EQUIRED.@{required}}"/>
+
+                <!-- Print Description -->
+                <if>
+                    <isset property="R-EQUIRED.@{required}.description"/>
+                <then>
+                    <echo append="true"
+                          file="${required.parameters.location}"># ${R-EQUIRED.@{required}.description}
+</echo>
+                </then>
+                </if>
+
+                <var name="tmp.param.value" unset="true"/>
+                <property name="tmp.param.value" value=""/>
+                <if>
+                    <or>
+                        <not><isset property="R-EQUIRED.@{required}"/></not>
+                        <equals arg1="${R-EQUIRED.@{required}}" arg2="" trim="true"/>
+                        <contains string="${R-EQUIRED.@{required}}" substring=".parameters.shared."/>
+                    </or>
+                <then>
+                    <echo append="true"
+                          file="${required.parameters.location}">@{required}=
+</echo>
+                    <property name="tmp.unset.required.parameter.exists" value="true"/>
+                    <echo>
+--------
+WARNING: The value of the Required Parameter 
+--------    @{required}
+         was not set! 
+         Please, update Required Parameters Settings File:
+            ${required.parameters.location}
+
+</echo>
+                </then>
+                <else>
+                    <propertyregex
+                        property="tmp.param.value" 
+                        input="${R-EQUIRED.@{required}}"
+                        regexp="\\"
+                        replace="\\\\\\\\"
+                        global="true"
+                        override="true"
+                        defaultValue="${R-EQUIRED.@{required}}"
+                    />
+                    <echo append="true"
+                          file="${required.parameters.location}">@{required}=${tmp.param.value}
+</echo>
+                </else>
+                </if>
+            </sequential>
+        </for>
+        <fail if="tmp.unset.required.parameter.exists">...
+------
+ERROR: Some of the Required Parameters for selected Test Suites:
+------      ${test.suites.names.list}
+       were not set. 
+       Please, update Requirted Parameters Settings File:
+            ${required.parameters.location}
+</fail>
+
+    </target>
+
+    <target name="define-suites-ids">
+        <!-- do define IDs for the parameters for each particular 
+             tets suite -->
+        <for list="${test.suites.names.list}" param="suite">
+        <sequential>
+            <propertyset id="@{suite}.parameters.id">
+                <propertyset refid="resolved.external.parameters.id"/>
+                <propertyset refid="framework.parameters.id"/>
+                <propertyset refid="global.build.parameters.id"/>
+                <!-- required parameters in the simple form -->
+                <propertyset>
+                    <propertyset refid="required.parameters.simple.id"/> 
+                    <propertyref prefix="@{suite}"/>
+                </propertyset>
+                <!-- required parameters in the simple form 
+                     without suite name -->
+                <propertyset>
+                    <propertyset refid="required.parameters.simple.id"/>
+                    <regexpmapper from="^@{suite}\.(.*)$" to="\1"/>
+                </propertyset>
+                <!-- shared parameters in any form" -->
+                <propertyset refid="shared.parameters.id"/>
+                <propertyset refid="shared.parameters.simple.id"/>
+                <!-- shared parameters in the simple form 
+                     without suite name -->
+                <propertyset>
+                    <propertyset refid="shared.parameters.simple.id"/>
+                    <regexpmapper from="^@{suite}\.(.*)$" to="\1"/>
+                </propertyset>
+            </propertyset>
+        </sequential>
+        </for>
+    </target>
+
+    <!-- do test suites initialization work before adaptors execution -->
+    <target name="init-suites" 
+                depends="init-framework, process-required-parameters, 
+                            define-suites-ids, -delete-temporal-properties"/>
+
+    <!-- Sets up the suites -->
+    <target name="setup-suites" depends="init-suites">
+        <!-- load suites properties -->
+        <for list="${test.suites.names.list}" param="suite">
+        <sequential>
+            <echo>===========================================</echo>
+            <echo>Setup of '@{suite}' Test Suite..</echo>
+            <!-- check for the failures of the superior suites -->
+            <for list="${@{suite}.parameters.depends}" param="superior">
+            <sequential>
+                <log message="Check for setup failure of @{superior} = ${@{superior}.parameters.run.failed}"/>
+                <condition property="@{suite}.has.failed.superior">
+                    <or>
+                        <isset property="@{superior}.parameters.setup.failed"/>
+                        <isset property="@{superior}.parameters.setup.skipped"/>
+                    </or>
+                </condition>
+            </sequential>
+            </for>
+            <if>
+                <isset property="@{suite}.has.failed.superior"/>
+            <then>
+                <property name="@{suite}.parameters.setup.skipped" value="true"/>
+                <echo>
+--------
+WARNING: Suite '@{suite}' won't be set up as some of its superior
+-------- dependency suites:
+            ${@{suite}.parameters.depends}
+         failed to set up.
+</echo>
+            </then>
+            <else>
+                <call-to-adaptor suite="@{suite}" call="setup-suite"/>
+            </else>
+            </if>
+        </sequential>
+        </for>
+        <antcall target="check-status"/>
+    </target>
+
+    <!-- Run suites -->
+    <target name="run-suites" depends="init-suites">
+        <for list="${test.suites.names.list}" param="suite">
+        <sequential>
+            <log message="Run of '@{suite}' Test Suite."/>
+            <if>
+                <!-- check for setup failure -->
+                <or>
+                    <isset property="@{suite}.parameters.setup.failed"/>
+                    <isset property="@{suite}.parameters.setup.skipped"/>
+                </or>
+            <then>
+                <echo>
+--------
+WARNING: Suite '@{suite}' won't be launched because its setup failed.
+--------
+</echo>
+            </then>
+            <else>
+                <!-- check for the failures of the superior suites -->
+                <for list="${@{suite}.parameters.depends}" param="superior">
+                <sequential>
+                    <log message="Check for failure of @{superior} = ${@{superior}.parameters.run.failed}"/>
+                    <condition property="@{suite}.has.failed.superior">
+                        <or>
+                            <isset property="@{superior}.parameters.run.failed"/>
+                            <isset property="@{superior}.parameters.run.skipped"/>
+                        </or>
+                    </condition>
+                </sequential>
+                </for>
+                <if>
+                    <isset property="@{suite}.has.failed.superior"/>
+                <then>
+                    <property name="@{suite}.parameters.run.skipped" value="true"/>
+                    <echo>
+--------
+WARNING: Suite '@{suite}' won't be launched as some of its superior
+-------- dependency suites:
+            ${@{suite}.parameters.depends}
+         failed.
+</echo>
+                </then>
+                <else>
+                    <call-to-adaptor suite="@{suite}" call="run-suite"/>
+                </else>
+                </if>
+            </else>
+            </if>
+        </sequential>
+        </for>
+        <antcall target="check-status"/>
+    </target>
+
+    <macrodef name="call-to-adaptor">
+        <attribute name="suite"/>
+        <attribute name="call"/>
+        <sequential>
+            <!-- create the file for passing the values of shared properties 
+                 (they are starting with ${suite}. prefix ) -->
+            <tempfile destdir="${temp.files.dir}"
+                      property="tmp.result.file"/>
+
+            <ant dir="${adaptors.dir}/@{suite}"
+                 antfile="${scripts.dir}/exec-adaptor.xml"
+                 target="@{call}"
+                 inheritAll="true">
+                <property name="suite.name" value="@{suite}"/>
+                <property name="suite.adaptor.dir" location="${adaptors.dir}/@{suite}"/>
+                <property name="result.file.location" value="${tmp.result.file}"/>
+                <!-- pass the set of all of the parameters needed to be known 
+                     by @{suite} -->
+                <propertyset refid="@{suite}.parameters.id"/>
+            </ant>
+
+            <!-- import resulting suite's parameter values -->
+            <var file="${tmp.result.file}"/>
+
+            <!-- Resolve names depending on suite's shared parameters -->
+            <resolve-parameters file="${tmp.result.file}"/>
+            
+            <!-- remove the temporary objects -->
+            <delete file="${tmp.result.file}" quiet="true" verbose="false"/>
+            <var name="tmp.result.file" unset="true"/>
+        </sequential>
+    </macrodef>
+
+    <!-- Resolve the values of the parameters depending 
+         on internal adaptor's properties -->
+    <macrodef name="resolve-parameters">
+        <!-- resolve for all suites by default -->
+        <attribute name="suite" default="[^\.]*"/>
+        <!-- helper file used for names resolution -->
+        <attribute name="file"/>
+        <sequential>
+            <!-- save -->
+            <save-parameters file="@{file}" suite="@{suite}"/>
+            <!-- load -->
+            <var file="@{file}"/>
+            <!-- == reload :) -->
+        </sequential>
+    </macrodef>
+
+    <!-- Save the values of the parameters -->
+    <macrodef name="save-parameters">
+        <!-- save for specified suite -->
+        <attribute name="suite" default="[^\.]*"/>
+        <!-- file where parameters will be saved -->
+        <attribute name="file"/>
+        <sequential>
+            <echoproperties destfile="@{file}">
+                <propertyset>
+                    <propertyref regex="@{suite}\.parameters\."/>
+                </propertyset>
+            </echoproperties>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="print-parameters">
+        <attribute name="suite" default="[^\.]*"/>
+        <sequential>
+            <log message="====== Parameters of @{suite} =========="/>
+            <propertyselector 
+                property="tmp.params.list"
+                delimiter=","
+                match="@{suite}\.parameters\..*"
+                override="true"
+            />
+            <sortlist 
+                property="tmp.sorted.list"
+                value="${tmp.params.list}"
+                delimiter=","
+                override="true"
+            />
+            <for list="${tmp.sorted.list}" param="param">
+                <sequential>
+                    <log message="@{param}=${@{param}}"/>
+                </sequential>
+            </for>
+        </sequential>
+    </macrodef>
+
+    <target name="reorder-suites" depends="define-tasks, load-suites-parameters">
+        <tempfile destdir="${temp.files.dir}"
+                  property="tmp.sort.suites.file"/>
+        <!-- create temporary file used for ordering -->
+        <touch file="${tmp.sort.suites.file}"/>
+        <!-- the list to work over -->
+        <var name="tmp.list" value="${test.suites.names.list}"/>
+        <!-- remove the dependencies on unselected suites -->
+        <for list="${tmp.list}" param="suite">
+            <sequential>
+                <remove-unselected 
+                    suite="@{suite}" 
+                    selected.list="${tmp.list}"
+                    depends.list="${@{suite}.parameters.depends}"
+                    property="tmp.@{suite}.depends"
+                />
+                <!-- replace the suite parameter value -->
+                <var name="@{suite}.parameters.depends" 
+                     value="${tmp.@{suite}.depends}"/>
+            </sequential>
+        </for>
+
+        <for list="${tmp.list}" param="tmp">
+            <sequential>
+                <!-- place independent suites to the ordering file 
+                     and remove from dependent suites list (tmp.list) -->
+                <for list="${tmp.list}" param="suite">
+                    <sequential>
+                        <if>
+                            <length string="${tmp.@{suite}.depends}" 
+                                    length="0"/>
+                        <then>
+                            <echo file="${tmp.sort.suites.file}" 
+                                  append="true">
+                                  @{suite}=</echo>
+                            <!-- remove from dependent suites list -->
+                            <propertyregex 
+                                    property="tmp.list"
+                                    override="yes"
+                                    input="${tmp.list}"
+                                    regexp="\b@{suite}\b,*" replace=""
+                                    defaultValue="${tmp.list}"/>
+                        </then>
+                        </if>
+                    </sequential>
+                </for>
+                <!-- Remove non-selected dependencies -->
+                <for list="${tmp.list}" param="suite">
+                    <sequential>
+                        <remove-unselected 
+                            suite="@{suite}" 
+                            selected.list="${tmp.list}"
+                            depends.list="${tmp.@{suite}.depends}"
+                            property="tmp.@{suite}.depends"
+                        />
+                    </sequential>
+                </for>
+            </sequential>
+        </for>
+        <!-- unset temporary properties -->
+        <var name="tmp.list" unset="true"/>
+        <for list="${test.suites.names.list}" param="suite">
+            <sequential>
+                <var name="tmp.@{suite}.depends" unset="true"/>
+            </sequential>
+        </for>
+        <!-- do sort suite names -->
+        <sortlist property="test.suites.names.list" 
+                  override="yes"
+                  value="${test.suites.names.list}"
+                  orderPropertyFile="${tmp.sort.suites.file}">
+        </sortlist>
+        <log message="Sorted List of Test Suites: ${test.suites.names.list}"/>
+        <delete file="${tmp.sort.suites.file}" quiet="true" verbose="false"/>
+    </target>
+
+    <!-- removes temporal properties (starting with tmp. prefix ) -->
+    <target name="-delete-temporal-properties">
+        <propertyselector 
+            property="temp.pack.list"
+            override="true"
+            delimiter=","
+            match="^tmp\..*"
+        />
+        <for list="${temp.pack.list}" param="temp">
+            <sequential>
+                <var name="@{param}" unset="true"/>
+            </sequential>
+        </for>
+    </target>
+
+    <macrodef name="remove-unselected">
+        <attribute name="suite"/>
+        <attribute name="selected.list"/>
+        <attribute name="depends.list"/>
+        <attribute name="property"/>
+        <sequential>
+            <var name="@{property}" value=""/>
+            <for list="@{depends.list}" param="depends">
+                <sequential>
+                    <if>
+                        <contains string=",@{selected.list}," substring=",@{depends},"/>
+                    <then>
+                        <var name="@{property}" value="${@{property}},@{depends}"/>
+                        <!-- echo>    dependency '@{depends}' selected to run</echo-->
+                    </then>
+                    </if>
+                </sequential>
+            </for>
+            <!-- remove leading coma -->
+            <propertyregex 
+                    property="@{property}" 
+                    override="yes"
+                    input="${@{property}}" 
+                    regexp="^,*" replace=""
+                    defaultValue="${@{property}}"/>
+        </sequential>
+    </macrodef>
+
+    <!-- check execution status -->
+    <target name="check-status">
+        <for list="${test.suites.names.list}" param="suite">
+        <sequential>
+            <if>
+                <!-- check for setup failure -->
+                <isset property="@{suite}.parameters.setup.failed"/>
+            <then>
+                <property name="has.failure" value="true"/>
+                <echo>
+------
+ERROR: Setup of Test Suite '@{suite}' FAILED.
+------
+</echo>
+            </then>
+            </if>
+            <if>
+                <!-- check for setup failure -->
+                <isset property="@{suite}.parameters.setup.skipped"/>
+            <then>
+                <property name="has.failure" value="true"/>
+                <echo>
+--------
+WARNING: Setup of Test Suite '@{suite}' SKIPPED.
+--------
+</echo>
+            </then>
+            </if>
+            <if>
+                <!-- check for setup failure -->
+                <isset property="@{suite}.parameters.run.skipped"/>
+            <then>
+                <property name="has.failure" value="true"/>
+                <echo>
+--------
+WARNING: Execution of Test Suite '@{suite}' SKIPPED.
+--------
+</echo>
+            </then>
+            </if>
+            <if>
+                <!-- check for setup failure -->
+                <isset property="@{suite}.parameters.run.failed"/>
+            <then>
+                <property name="has.failure" value="true"/>
+                <echo>
+------
+ERROR: Execution of Test Suite '@{suite}' FAILED.
+------
+</echo>
+            </then>
+            </if>
+        </sequential>
+        </for>
+        <fail message="There are Test Suites failures" if="has.failure"/>
+    </target>
+
+    <!-- removes svn locks leaved after unsuccessful checkout or update-->
+    <macrodef name="svn-cleanup">
+        <attribute name="trunk"/>
+        <sequential>
+            <delete quiet="true" verbose="false">
+                <fileset dir="@{trunk}" defaultexcludes="no" includes="**/.svn/lock"/>
+            </delete>
+        </sequential>
+    </macrodef>
+
+    <!-- does svn checkout -->
+    <macrodef name="svn-co">
+        <attribute name="url"/>
+        <attribute name="trunk"/>
+        <sequential>
+            <svn-cleanup trunk="@{trunk}"/>
+            <exec executable="svn" dir="@{trunk}" failonerror="true">
+                <arg line="co @{url} @{trunk}"/>
+            </exec>
+        </sequential>
+    </macrodef>
+
+    <!-- does svn update of BT workspace -->
+    <macrodef name="svn-update-bt">
+        <attribute name="path"/>
+        <sequential>
+            <!-- svn-cleanup trunk="@{trunk}"/>
+            <exec executable="svn" dir="@{trunk}" failonerror="true">
+                <arg line="up @{url} @{trunk}"/>
+            </exec -->
+        </sequential>
+    </macrodef>
+
+    <!-- macrodefinition checking the property pointing to the file -->
+    <macrodef name="check-file-pointer">
+        <attribute name="property"/>
+        <attribute name="type" default="file"/>
+        <sequential>
+            <echo>Check for @{property} pointing to '${@{property}}' file</echo>
+            <fail>
+                <condition>
+                    <not>
+                        <isset property="@{property}"/>
+                    </not>
+                </condition>
+                &nullFilePointerMessage;
+            </fail>
+            <fail>
+                <condition>
+                    <not>
+                        <available file="${@{property}}" type="@{type}"/>
+                    </not>
+                </condition>
+                &unexistingFilePointerMessage;
+            </fail>
+            <echo message="ok"/>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="log">
+        <attribute name="message"/>
+        <sequential>
+            <if>
+                <istrue value="${framework.parameters.optional.dolog}"/>
+            <then>
+                <echo>[${ant.project.name}]: @{message}</echo>
+            </then>
+            </if>
+        </sequential>
+    </macrodef>
+</project>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template Mon Apr 23 22:30:55 2007
@@ -0,0 +1,9 @@
+# Do you want to sent email notifications and to where? and from whom?
+#
+# framework.parameters.usemail=some.smtp.host
+# framework.parameters.usemail.to=some@mail.address.net
+# framework.parameters.usemail.from=me@some.host
+
+# Do you want to see framework execution log?
+framework.parameters.options.dolog=false
+

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,31 @@
+<parameters>
+    <required/>
+
+    <!-- optional framework preferences -->
+    <optional>
+        <dolog value="false" description="Do you want to see Framework execution log?"/>
+    </optional>
+    
+    <cc doclean="false" description="Do clean working CC directory before execution?"/>
+    <cc webport="8080" description="The port on which CC will make its web publishing"/>
+    <cc jmxport="8000" description="The port for CC's JMX console."/>
+
+    <external>
+        <ant-contrib
+            jar="ant-contrib-1.0b3.jar"
+            url="http://kent.dl.sourceforge.net/sourceforge/ant-contrib/ant-contrib-1.0b3-bin.zip"
+            md5="c5a75fc28cbc52f09bd43b5506978601"
+        />
+        <junit
+            url="http://mirrors.ibiblio.org/pub/mirrors/maven2/junit/junit/3.8.2/junit-3.8.2.jar"
+            md5="28e7eb9eeefe31a657c68755bfccc541"
+        />
+        <cc
+            url="http://downloads.sourceforge.net/cruisecontrol/cruisecontrol-bin-2.6.1.zip"
+            md5="1ea23663d90cc7d59ce6c6b8fbe79c95"
+            dir="cruisecontrol-bin-2.6.1"
+            inc="*/lib/**,*/webapps/**"
+        />
+    </external>
+</parameters>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-config-template.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-config-template.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-config-template.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-config-template.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,10 @@
+<cruisecontrol>
+    <!-- root dir of the BT Infra -->
+    <property name="root.dir" value="@BT.ROOTDIR@"/>
+    <!-- global properties of the BT Infra -->
+    <property name="framework.properties.location" value="@BT.PROPERTIES@"/>
+    <!-- import framework properties -->
+    <property file="${framework.properties.location}"/>
+    
+    <!-- test suites selected for execution -->@PROJECT@
+</cruisecontrol>

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-config-template.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-project-template.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-project-template.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-project-template.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-project-template.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,62 @@
+<cruisecontrol>
+
+    <!-- Keep this tag if you want to see any parameter value accessible 
+         from adaptor.xml here -->
+    <!-- @BT.PARAMETERS.INCLUDE@ -->
+    
+    <!-- Tag resolved to the name of 
+         the test suite this config is related to. -->
+    <project name="@BT.PROJECT@" buildafterfailed="false">
+
+        <listeners>
+            <!-- Resolved to <currentbuildstatuslistener file="${logs.dir}/...">
+                 Should be here if there are any suites depending
+                 on run status of this suite -->
+            <!-- @BT.LISTENER@ -->
+        </listeners>
+
+        <bootstrappers>
+            <!-- Resolved to 
+                    <svnbootstrapper> 
+                 if we use SVN for sources, i.e. 
+                    ${suite.name}.parameters.cc.usesvn="${sources.location}"
+                 is set -->
+            <!-- @BT.BOOTSTRAPPER@ -->
+        </bootstrappers>
+
+        <modificationset quietperiod="60">
+            <!-- Tag Resolution Rules: 
+                - in case of defined SVN (@{suite.name}.parameters.cc.usesvn),
+                  resolved to
+                    <svn LocalWorkingCopy="${path.to.local.svn.repository}"/>
+                - in case of defined trigger (@{suite.name}.parameters.cc.trigger),
+                  resolved to
+                    <filesystem folder="${path.to.trigger.file}"
+                - for any dependency it is resolved to
+                    <buildstatus logdir='${path.to.log.for.some.suite}'/>
+                  if the dependency uses svn, it is aslo resolved to
+                    <svn localWorkingCopy=../>
+                - in any case it is additionally resolved to
+                    <forceonly/>
+            -->
+            <!-- @BT.MODIFICATIONSET@ -->
+        </modificationset>
+
+        <schedule interval="300">
+            <!-- This tag MUST be present!
+                 It makes correct call to adaptor's run target -->
+            <!-- @BT.ADAPTORCALL@ -->
+        </schedule>
+
+        <log>
+            <!-- @BT.TEST.RESULTS@ -->
+        </log>
+
+        <publishers>
+            <!-- Keep it if you want to use custom ant publishers
+                 specified for test suite by cc.publisher parameter -->
+            <!-- @BT.PUBLISHER@ -->
+        </publishers>
+
+    </project>
+</cruisecontrol>

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-project-template.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message