harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r642920 - in /harmony/enhanced/buildtest/trunk/infra: build.xml scripts/config.xml scripts/framework.properties scripts/framework.xml
Date Mon, 31 Mar 2008 08:14:32 GMT
Author: smishura
Date: Mon Mar 31 01:14:30 2008
New Revision: 642920

URL: http://svn.apache.org/viewvc?rev=642920&view=rev
Log:
* Add generation of selected-suites.properties
* Switch to configs files (selected-suites.properties & required-parameters.properties)
created by config.xml

Modified:
    harmony/enhanced/buildtest/trunk/infra/build.xml
    harmony/enhanced/buildtest/trunk/infra/scripts/config.xml
    harmony/enhanced/buildtest/trunk/infra/scripts/framework.properties
    harmony/enhanced/buildtest/trunk/infra/scripts/framework.xml

Modified: harmony/enhanced/buildtest/trunk/infra/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/infra/build.xml?rev=642920&r1=642919&r2=642920&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/build.xml (original)
+++ harmony/enhanced/buildtest/trunk/infra/build.xml Mon Mar 31 01:14:30 2008
@@ -246,31 +246,8 @@
                          Framework Setup Functionality
          ================================================================== -->
 
-    <target name="setup"
-            depends="setup-framework,
-                     -save-suites-configuration,
-                     load-required-parameters,
-                     save-required-parameters" />
-
-    <target name="-save-suites-configuration" depends="define-ant-contrib">
-        <echo file="${selected.suites.configuration}"># autogenerated file containing
test run setup information
-
-# Selected test suites will be executed in the following order:${line.separator}</echo>
-        <echo file="${selected.suites.configuration}"
-              append="true"
-              message="test.suites.names.list=${test.suites.names.list}${line.separator}"
/>
-
-        <echo file="${selected.suites.configuration}" append="true">
-# This order has been obtained on the base of the following
-# information about dependencies between test suites:${line.separator}</echo>
-
-        <for list="${test.suites.names.list}" param="suite">
-            <sequential>
-                <echo file="${selected.suites.configuration}"
-                      append="true"
-                      message="@{suite}.parameters.depends=${@{suite}.parameters.depends}${line.separator}"
/>
-            </sequential>
-        </for>
+    <target name="setup" >
+        <!-- Currently does nothing. Will move suites' setup here -->
     </target>
 
     <!-- ================================================================== 

Modified: harmony/enhanced/buildtest/trunk/infra/scripts/config.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/infra/scripts/config.xml?rev=642920&r1=642919&r2=642920&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/scripts/config.xml (original)
+++ harmony/enhanced/buildtest/trunk/infra/scripts/config.xml Mon Mar 31 01:14:30 2008
@@ -18,7 +18,7 @@
 <project name="config" default="generate-config" basedir=".">
 
     <!-- temporary file to store intermediate results of iteration -->
-    <property name="tmp.file" value="tmp.txt" />
+    <property name="tmp.file" location="${scripts.dir}/tmp.txt" />
 
     <target name="generate-config">
 
@@ -73,6 +73,44 @@
                 <propertyset refid="global.build.parameters.id" />
             </propertyset>
         </ant>
+
+        <!-- fourth stage: extract depends properties
+                 to a separate file - 'selected-suites.properties'  -->
+
+        <!-- get all 'depends' suites as a list -->
+        <loadfile property="depends.suites" srcfile="${all.props}">
+            <filterchain>
+                <linecontainsregexp>
+                    <regexp pattern="[^.]+\.parameters\.depends=" />
+                </linecontainsregexp>
+                <tokenfilter>
+                    <linetokenizer />
+                    <replaceregex pattern="[^.]+\.parameters\.depends=(.+)"
+                                  replace="\1," />
+                </tokenfilter>
+                <striplinebreaks />
+            </filterchain>
+        </loadfile>
+
+        <!-- check if the suites in the list were selected -->
+        <subant genericantfile="${scripts.dir}/config.xml"
+                target="-remove-if-not-selected"
+                inheritall="true"
+                inheritrefs="true">
+            <dirset dir="${adaptors.dir}" includes="${depends.suites}" />
+        </subant>
+
+        <!-- flash the list into the file -->
+        <echo message="" file="${selected.suites.configuration}" />
+        <subant genericantfile="${scripts.dir}/config.xml"
+                target="-flash-selected"
+                inheritall="false">
+            <dirset dir="${adaptors.dir}" includes="${test.suites}" />
+            <propertyset>
+                <propertyref name="selected.suites.configuration" />
+                <propertyref name="all.props" />
+            </propertyset>
+        </subant>
     </target>
 
     <!-- The target is workaround for properties cycle dependencies
@@ -273,5 +311,57 @@
 </echo>
         </sequential>
     </macrodef>
-</project>
 
+    <target name="-remove-if-not-selected"
+            unless="${suite.name}.was.selected"
+            depends="-check-if-selected">
+
+        <!-- Stepan: I failed to develop one regexp. for all cases
+                     so do the removal in two steps
+             If you know the better was please let me know
+        -->
+
+        <!-- remove dependency from a suite's list -->
+        <replaceregexp file="${all.props}"
+                       match="([^.]\.parameters\.depends=.*),${suite.name}(.*)"
+                       replace="\1\2"
+                       flags="g" />
+        <replaceregexp file="${all.props}"
+                       match="([^.]\.parameters\.depends=)${suite.name},?(.*)"
+                       replace="\1\2"
+                       flags="g" />
+    </target>
+
+    <target name="-check-if-selected">
+
+        <basename file="${basedir}" property="suite.name" />
+
+        <condition property="${suite.name}.was.selected">
+            <contains string="${test.suites}," substring="${suite.name}" />
+        </condition>
+    </target>
+
+    <target name="-flash-selected">
+
+        <basename file="${basedir}" property="suite.name" />
+        <property file="${all.props}" />
+
+        <set-value suite="${suite.name}" />
+
+        <echo message="${value}${line.separator}"
+              file="${selected.suites.configuration}"
+              append="true" />
+    </target>
+
+    <macrodef name="set-value">
+        <attribute name="suite" />
+        <sequential>
+            <condition property="value"
+                       value="@{suite}.parameters.depends=${@{suite}.parameters.depends}"
+                       else="@{suite}.parameters.depends=">
+                <isset property="@{suite}.parameters.depends" />
+            </condition>
+        </sequential>
+    </macrodef>
+
+</project>

Modified: harmony/enhanced/buildtest/trunk/infra/scripts/framework.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/infra/scripts/framework.properties?rev=642920&r1=642919&r2=642920&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/scripts/framework.properties (original)
+++ harmony/enhanced/buildtest/trunk/infra/scripts/framework.properties Mon Mar 31 01:14:30
2008
@@ -3,7 +3,6 @@
 
 required.parameters.location=${root.dir}/required-parameters.properties
 backup.parameters.location=${root.dir}/backup-parameters.properties
-selected.suites.configuration=${root.dir}/selected-suites.properties
 
 execution.timeout=10000
 
@@ -26,3 +25,4 @@
 config.dir=${build.dir}/config
 
 external.resources.location=${config.dir}/resources.location
+selected.suites.configuration=${config.dir}/selected-suites.props

Modified: harmony/enhanced/buildtest/trunk/infra/scripts/framework.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/infra/scripts/framework.xml?rev=642920&r1=642919&r2=642920&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/scripts/framework.xml (original)
+++ harmony/enhanced/buildtest/trunk/infra/scripts/framework.xml Mon Mar 31 01:14:30 2008
@@ -152,176 +152,7 @@
     </target>
 
     <target name="load-required-parameters" depends="load-parameters">
-        <touch file="${required.parameters.location}"/>
-        <!-- load preset required parameters from the file -->
-        <loadproperties srcfile="${required.parameters.location}">
-            <filterchain>
-                <striplinecomments>
-                    <comment value="#"/>
-                </striplinecomments>
-                <deletecharacters chars="\t"/>
-                <trim/>
-                <ignoreblank/>
-                <replaceregex pattern="\\" replace="\\\\\\\\" flags="g"/>
-                <prefixlines prefix="tmp.preset.required."/>
-            </filterchain>
-        </loadproperties>
-        <!-- echoproperties>
-            <propertyset>
-                <propertyref prefix="tmp.preset.required."/>
-            </propertyset>
-        </echoproperties -->
-        <property name="tmp.preset.params.list" value=""/>
-        <propertyselector 
-            property="tmp.preset.params.list"
-            override="true"
-            delimiter=","
-            match="^tmp\.preset\.required\.(.*)$"
-            select="\1"
-            distinct="true"
-        />
-        <log message="Preset required parameters: ${tmp.preset.params.list}"/>
-        <!-- Set up Required Parameter values and remove possible trash 
-             properties got from the file -->
-        <for list="${tmp.preset.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" 
-                     value="${tmp.preset.required.@{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"
-                          message="@{preset}=${tmp.param.value}${line.separator}"/>
-                </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>
-    </target>
-
-    <!-- Updates the file containing all of the required properties -->
-    <target name="save-required-parameters">
-        
-        <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="${test.suites.names.list}" param="suite">
-        <sequential>
-            <log message="Update required parameters for '@{suite}'"/>
-            <var name="tmp.required.parameters.list" value=""/>
-            <propertyselector 
-                property="tmp.required.parameters.list"
-                override="true"
-                delimiter=","
-                match="^(@{suite}\.parameters\.required\..*?)(?:\.description)?$"
-                select="\1"
-                distinct="true"
-            />
-            <for list="${tmp.required.parameters.list}" param="required" trim="yes">
-            <sequential>
-                <var name="tmp.short.param.key" value=""/>
-                <!-- bring the parameter key to short form -->
-                <propertyregex
-                    property="tmp.short.param.key" 
-                    input="@{required}"
-                    regexp="^@{suite}\.parameters\.required\.(.*?)$"
-                    replace="@{suite}.\1"
-                    override="true"
-                />
-                <log message="Processing of @{required} = ${@{required}}"/>
-                <!-- write description -->
-                <echo file="${required.parameters.location}" append="true"
-                      message="# ${@{required}.description}${line.separator}"/>
-                <if>
-                    <or><not><isset property="@{required}"/></not>
-                        <equals arg1="${@{required}}" arg2="" trim="true"/>
-                        <contains string="${@{required}}" 
-                                  substring=".parameters.shared."/>
-                    </or>
-                <then>
-                    <echo file="${required.parameters.location}" append="true"
-                          message="${tmp.short.param.key}=${line.separator}"/>
-                    <property name="tmp.unset.required.parameter.exists" value="true"/>
-                    <echo>
---------
-WARNING: The value of the Required Parameter 
---------    ${tmp.short.param.key}
-         was not set! 
-         Please, update Required Parameters Settings File:
-            ${required.parameters.location}
-                    </echo>
-                </then>
-                <else>
-                    <echo file="${required.parameters.location}" append="true"
-                          message="${tmp.short.param.key}=${@{required}}${line.separator}"/>
-                </else>
-                </if>
-            </sequential>
-            </for>
-        </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>
+        <property file="${required.parameters.location}"/>
     </target>
 
     <target name="define-suites-ids">
@@ -361,7 +192,7 @@
     <!-- do test suites initialization work before adaptors execution -->
     <target name="init-suites" 
                 depends="init-framework, 
-                    load-required-parameters, save-required-parameters,
+                    load-required-parameters,
                         define-suites-ids, -delete-temporal-properties"/>
 
     <!-- Sets up the suites -->



Mime
View raw message