21 ============================================================================ |
21 ============================================================================ |
22 --> |
22 --> |
23 <project name="run-scenario" xmlns:ac="antlib:net.sf.antcontrib" xmlns:au="antlib:org.apache.ant.antunit"> |
23 <project name="run-scenario" xmlns:ac="antlib:net.sf.antcontrib" xmlns:au="antlib:org.apache.ant.antunit"> |
24 <description>Helium Antlib logger macro.</description> |
24 <description>Helium Antlib logger macro.</description> |
25 |
25 |
26 <target name="setUp"> |
26 <target name="setUp"> |
27 <tempfile property="temp.dir" suffix=".dir" /> |
27 <tempfile property="temp.dir" suffix=".dir" /> |
28 <mkdir dir="${temp.dir}" /> |
28 <mkdir dir="${temp.dir}" /> |
|
29 <echo>--------------------------------------------</echo> |
29 </target> |
30 </target> |
30 |
31 |
31 <target name="tearDown"> |
32 <target name="tearDown"> |
|
33 <echo>--------------------------------------------</echo> |
32 <delete dir="${temp.dir}" /> |
34 <delete dir="${temp.dir}" /> |
33 </target> |
35 </target> |
34 |
36 |
35 <macrodef name="runScenario"> |
37 <macrodef name="runScenario"> |
36 <attribute name="scenario" /> |
38 <attribute name="scenario" /> |
37 <attribute name="target" /> |
39 <attribute name="target" /> |
38 <sequential> |
40 <sequential> |
39 <ac:trycatch property="scenario.unittest.error"> |
41 <exec osfamily="windows" executable="cmd" dir="${ant.file.run-scenario}/../../scenarii/@{scenario}" failonerror="true"> |
40 <try> |
42 <env key="ANT_ARGS" value="${env.ANT_ARGS} -listener com.nokia.helium.logger.ant.listener.StatusAndLogListener" /> |
41 <exec osfamily="windows" executable="cmd" dir="${file.run-scenario}/../../scenarii/@{scenario}" failonerror="true" errorproperty="scenario.unittest.error.log"> |
43 <arg line="/c ..\build.bat @{target}" /> |
42 <env key="ANT_ARGS" value="${env.ANT_ARGS} -listener com.nokia.helium.logger.ant.listener.StatusAndLogListener" /> |
44 <arg value="-Dant.executor.class=com.nokia.helium.core.ant.HeliumExecutor" /> |
43 <arg line="/c ..\build.bat @{target}" /> |
45 <arg value="-Dtemp.dir=${temp.dir}" /> |
44 <arg value="-Dant.executor.class=com.nokia.helium.core.ant.HeliumExecutor" /> |
46 </exec> |
45 <arg value="-Dtemp.dir=${temp.dir}" /> |
47 <exec osfamily="unix" executable="../bld.sh" dir="${ant.file.run-scenario}/../../scenarii/@{scenario}" failonerror="true"> |
46 </exec> |
48 <env key="ANT_ARGS" value="${env.ANT_ARGS} -listener com.nokia.helium.logger.ant.listener.StatusAndLogListener" /> |
47 <exec osfamily="unix" executable="../bld.sh" dir="${file.run-scenario}/../../scenarii/@{scenario}" failonerror="true" errorproperty="scenario.unittest.error.log"> |
49 <arg line="@{target}" /> |
48 <env key="ANT_ARGS" value="${env.ANT_ARGS} -listener com.nokia.helium.logger.ant.listener.StatusAndLogListener" /> |
50 <arg value="-Dant.executor.class=com.nokia.helium.core.ant.HeliumExecutor" /> |
49 <arg line="@{target}" /> |
51 <arg value="-Dtemp.dir=${temp.dir}" /> |
50 <arg value="-Dant.executor.class=com.nokia.helium.core.ant.HeliumExecutor" /> |
52 </exec> |
51 <arg value="-Dtemp.dir=${temp.dir}" /> |
|
52 </exec> |
|
53 </try> |
|
54 </ac:trycatch> |
|
55 <!--<loadfile property="scenario.unittest.error.log" srcFile="${temp.dir}/scenario.log" />--> |
|
56 <au:assertTrue message="${scenario.unittest.error.log}"> |
|
57 <not> |
|
58 <isset property="scenario.unittest.error" /> |
|
59 </not> |
|
60 </au:assertTrue> |
|
61 </sequential> |
53 </sequential> |
62 </macrodef> |
54 </macrodef> |
63 |
55 |
64 </project> |
56 </project> |