harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r643780 - in /harmony/enhanced/buildtest/trunk/infra: build.xml scripts/framework.xml scripts/setup.xml
Date Wed, 02 Apr 2008 07:56:34 GMT
Author: smishura
Date: Wed Apr  2 00:56:30 2008
New Revision: 643780

URL: http://svn.apache.org/viewvc?rev=643780&view=rev
Log:
Move suites' setup to a separate stage (i.e. top-level setup target)

Added:
    harmony/enhanced/buildtest/trunk/infra/scripts/setup.xml   (with props)
Modified:
    harmony/enhanced/buildtest/trunk/infra/build.xml
    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=643780&r1=643779&r2=643780&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/build.xml (original)
+++ harmony/enhanced/buildtest/trunk/infra/build.xml Wed Apr  2 00:56:30 2008
@@ -246,19 +246,45 @@
                          Framework Setup Functionality
          ================================================================== -->
 
-    <target name="setup" >
-        <!-- Currently does nothing. Will move suites' setup here -->
+    <target name="setup" depends="load-suites-configuration">
+
+        <!-- verify that all required params are set -->
+        <check-required-parameters />
+
+        <!-- get the list of installed suites -->
+        <pathconvert pathsep="," property="suites.setup.list">
+            <path>
+                <fileset dir="${config.dir}">
+                    <include name="*.properties" />
+                </fileset>
+            </path>
+            <chainedmapper>
+                <flattenmapper />
+                <globmapper from="*.properties" to="*" />
+            </chainedmapper>
+        </pathconvert>
+
+        <!-- temporary file to store intermediate results of iteration -->
+        <property name="tmp.file" location="${scripts.dir}/tmp.txt" />
+        <echo message="" file="${tmp.file}" />
+        <subant genericantfile="${scripts.dir}/setup.xml"
+                target="-setup-suite"
+                inheritall="true"
+                inheritrefs="true">
+            <dirset dir="${adaptors.dir}" includes="${suites.setup.list}" />
+        </subant>
+        <delete file="${tmp.file}" />
     </target>
 
     <!-- ================================================================== 
                           Test Execution Functionality
          ================================================================== -->
     <target name="run"
-            depends="check-setup, init-framework, init-suites, setup-suites, run-suites"
/>
+            depends="check-setup, init-framework, init-suites, run-suites" />
 
     <target name="run-cc"
             description="run-cc"
-            depends="check-setup, init-framework, setup-suites, check-status,
+            depends="check-setup, init-framework, check-status,
                         create-cc-configuration">
         <java jar="${ext.cc.location}/lib/cruisecontrol-launcher.jar"
               dir="${cc.work.dir}"

Modified: harmony/enhanced/buildtest/trunk/infra/scripts/framework.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/infra/scripts/framework.xml?rev=643780&r1=643779&r2=643780&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/scripts/framework.xml (original)
+++ harmony/enhanced/buildtest/trunk/infra/scripts/framework.xml Wed Apr  2 00:56:30 2008
@@ -190,40 +190,6 @@
                     load-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 -->
-            <check-superior-failures
-                suite="@{suite}"
-                check-target="setup"
-                property="@{suite}.has.failed.superior"
-            />
-            <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">
         <log message="Running the following suites: ${test.suites.names.list}."/>

Added: harmony/enhanced/buildtest/trunk/infra/scripts/setup.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/infra/scripts/setup.xml?rev=643780&view=auto
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/scripts/setup.xml (added)
+++ harmony/enhanced/buildtest/trunk/infra/scripts/setup.xml Wed Apr  2 00:56:30 2008
@@ -0,0 +1,83 @@
+<?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="setup" basedir=".">
+
+    <target name="-setup-suite" if="need.setup" depends="-init">
+
+        <echo message="#${suite.name}#" file="${tmp.file}" append="true" />
+
+        <!-- TODO: fail only if setup of dependency failed -->
+        <setup-dependencies suite="${suite.name}" />
+
+        <!-- setup suite -->
+        <property file="${config.dir}/${suite.name}.properties" />
+        <ant dir="${adaptors.dir}/${suite.name}"
+             antfile="${adaptors.dir}/${suite.name}/adaptor.xml"
+             target="setup"
+             inheritAll="true">
+            <property name="suite.adaptor.dir"
+                      location="${adaptors.dir}/${suite.name}" />
+        </ant>
+    </target>
+
+    <target name="-init">
+
+        <basename file="${basedir}" property="suite.name" />
+        <condition property="need.setup">
+            <isfileselected file="${tmp.file}">
+                <not>
+                    <contains text="#${suite.name}#" casesensitive="yes" />
+                </not>
+            </isfileselected>
+        </condition>
+    </target>
+
+    <macrodef name="setup-dependencies">
+        <attribute name="suite" />
+        <sequential>
+
+            <property name="dependencies.list"
+                      value="${@{suite}.parameters.depends}" />
+
+            <condition property="@{suite}.has.dependency">
+                <length string="${dependencies.list}"
+                        trim="true"
+                        length="0"
+                        when="greater" />
+            </condition>
+
+            <subant genericantfile="${scripts.dir}/setup.xml"
+                    target="-setup-dependencies"
+                    inheritall="true"
+                    buildpath="${scripts.dir}" />
+        </sequential>
+    </macrodef>
+
+    <target name="-setup-dependencies" if="${suite.name}.has.dependency">
+        <subant genericantfile="${scripts.dir}/setup.xml"
+                target="-setup-suite"
+                inheritall="false">
+            <dirset dir="${adaptors.dir}" includes="${dependencies.list}" />
+            <property name="adaptors.dir" value="${adaptors.dir}" />
+            <property name="config.dir" value="${config.dir}" />
+            <property name="scripts.dir" value="${scripts.dir}" />
+            <property name="tmp.file" value="${tmp.file}" />
+        </subant>
+    </target>
+
+</project>

Propchange: harmony/enhanced/buildtest/trunk/infra/scripts/setup.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message