buildframework/helium/sf/java/legacy/tests/antunit/run-scenario.ant.xml
changeset 628 7c4a911dc066
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!-- 
       
     3 ============================================================================ 
       
     4 Name        : test_signaltask.ant.xml 
       
     5 Part of     : Helium AntLib
       
     6 
       
     7 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     8 All rights reserved.
       
     9 This component and the accompanying materials are made available
       
    10 under the terms of the License "Eclipse Public License v1.0"
       
    11 which accompanies this distribution, and is available
       
    12 at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    13 
       
    14 Initial Contributors:
       
    15 Nokia Corporation - initial contribution.
       
    16 
       
    17 Contributors:
       
    18 
       
    19 Description:
       
    20 
       
    21 ============================================================================
       
    22 -->
       
    23 <project name="run-scenario" xmlns:ac="antlib:net.sf.antcontrib" xmlns:au="antlib:org.apache.ant.antunit">
       
    24     <description>Helium Antlib feature enabler macro.</description>
       
    25 
       
    26     <target name="setUp">    
       
    27         <tempfile property="temp.dir" suffix=".dir" />
       
    28         <mkdir dir="${temp.dir}" />
       
    29     </target>
       
    30     
       
    31     <target name="tearDown">
       
    32         <delete dir="${temp.dir}" />
       
    33     </target>
       
    34     
       
    35     <macrodef name="runScenario">
       
    36         <attribute name="scenario" />
       
    37         <attribute name="target" />
       
    38         <attribute name="cmdline" default=""/>
       
    39         <sequential>
       
    40             <ac:trycatch property="scenario.unittest.error">
       
    41                 <try>
       
    42                     <exec osfamily="windows" executable="cmd" dir="${ant.file.run-scenario}/../../scenarii/@{scenario}" failonerror="true" errorproperty="scenario.unittest.error.log">
       
    43                         <env key="ANT_ARGS" value="${env.ANT_ARGS} -logger com.nokia.ant.HeliumLogger" />
       
    44                         <arg line="/c ..\build.bat @{target}" />
       
    45                         <arg value="-Dant.executor.class=com.nokia.helium.core.ant.HeliumExecutor" />
       
    46                         <arg value="-Dtemp.dir=${temp.dir}" />
       
    47                         <arg value="-Dhelium.dir=${ant.file.run-scenario}/../../scenarii/property" />
       
    48                     </exec>
       
    49                     <exec osfamily="unix" executable="../bld.sh" dir="${ant.file.run-scenario}/../../scenarii/@{scenario}" failonerror="true" errorproperty="scenario.unittest.error.log">
       
    50                         <env key="ANT_ARGS" value="${env.ANT_ARGS} -logger com.nokia.ant.HeliumLogger" />
       
    51                         <arg value="-Dant.executor.class=com.nokia.helium.core.ant.HeliumExecutor" />
       
    52                         <arg line="@{target}" />
       
    53                         <arg value="-Dtemp.dir=${temp.dir}" />
       
    54                         <arg line="@{cmdline}" />
       
    55                         <arg value="-Dhelium.dir=${ant.file.run-scenario}/../../scenarii/property" />
       
    56                     </exec>
       
    57                 </try>
       
    58             </ac:trycatch>
       
    59             <!--<loadfile property="scenario.unittest.error.log" srcFile="${temp.dir}/scenario.log" />-->
       
    60             <au:assertTrue message="${scenario.unittest.error.log}">
       
    61                 <not>
       
    62                     <isset property="scenario.unittest.error" />
       
    63                 </not>
       
    64             </au:assertTrue>
       
    65         </sequential>
       
    66     </macrodef>
       
    67 
       
    68 </project>