Simplified code for reading ATS worker root. Plus clearer error message if it cannot be read.
authorSimon Howkins <simonh@symbian.org>
Tue, 12 Oct 2010 12:48:26 +0100
changeset 1301 dfefb892e7f8
parent 1300 fe97a9594f6c
child 1302 13e40df94492
Simplified code for reading ATS worker root. Plus clearer error message if it cannot be read.
common/build.test.xml
--- a/common/build.test.xml	Mon Oct 11 16:04:35 2010 +0100
+++ b/common/build.test.xml	Tue Oct 12 12:48:26 2010 +0100
@@ -4,13 +4,17 @@
     <target name="sf-test-smoketest" depends="sf-prebuild,sf-build-smoketestpkg,sf-send-testpkg,sf-zip-logs,sf-publish" />
     <target name="sf-test-bc-check" depends="sf-prebuild,sf-bc-check,sf-zip-logs,sf-publish" />
 
-    <target name="sf-find-ATS-worker-root">
-      <exec executable="perl" dir="${sf.common.config.dir}/tools/ats/devices" failonerror="false" outputproperty="sf.spec.test.workerroot">
-        <arg value="-pe"/>
-        <arg value="&quot;m/TEMPDIR=(\S+)/;print $1;s/.*\n//g&quot;"/>
-        <arg value="${env.COMPUTERNAME}\EMULATOR_GENERIC_${env.COMPUTERNAME}.properties" /> 
-      </exec>
-      <echo message="ATS Worker Root = ${sf.spec.test.workerroot}"/> 
+    <target name="sf-find-ATS-worker-root" unless="sf.spec.test.workerroot">
+      <property file="${sf.common.config.dir}/tools/ats/devices/${env.COMPUTERNAME}/EMULATOR_GENERIC_${env.COMPUTERNAME}.properties" prefix="sf.test.searching.for.temp.dir"/>
+      <fail message="Unable to read TEMPDIR from ${sf.common.config.dir}/tools/ats/devices/${env.COMPUTERNAME}/EMULATOR_GENERIC_${env.COMPUTERNAME}.properties to set ATS worker root">
+        <condition>
+          <not>
+            <isset property="sf.test.searching.for.temp.dir.TEMPDIR"/>
+          </not>
+        </condition>
+      </fail>
+      <property name="sf.spec.test.workerroot" value="${sf.test.searching.for.temp.dir.TEMPDIR}"/>
+      <echo message="ATS Worker Root = ${sf.spec.test.workerroot}"/>
     </target>
     
     <target name ="sf-make-junction" depends="sf-find-ATS-worker-root">        
@@ -24,7 +28,7 @@
     </target>
 
     <target name ="sf-delete-junction" depends="sf-find-ATS-worker-root">
-        <exec executable="junction.exe" dir="${sf.spec.test.workerroot}/${sf.spec.test.epocroot}" failonerror="false" output="${build.log.dir}/ATS_${build.id}_delete_junction.log">
+      <exec executable="junction.exe" dir="${sf.spec.test.workerroot}/${sf.spec.test.epocroot}" failonerror="false" output="${build.log.dir}/ATS_${build.id}_delete_junction.log">
         <arg value="-d"/>
         <arg value="epoc32"/>
       </exec>