ctf: Check that test traces exist before verifying checksum
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Fri, 5 Sep 2014 13:12:03 +0000 (09:12 -0400)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Fri, 5 Sep 2014 15:06:50 +0000 (11:06 -0400)
Change-Id: I13858eb2eb5f2890716b503634a54fdf5a007551
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/32928
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Hudson CI
org.eclipse.linuxtools.ctf.core.tests/traces/get-traces.xml

index a62570b3edc17b92c3e2de647fb7c9104594b2db..a09b1703ebbbecdd2d29b13fc10ca82c55ca61ba 100644 (file)
 
 <project name="Extract Traces" default="main" >
 <target name="main">
-  <condition property="failedCheckSum">
-    <not>
-      <and>
-        <checksum>
-          <fileset dir="." includes="*.tar.bz2" />
-          <fileset dir="." includes="*.tar.gz" />
-          <fileset dir="." includes="*.zip" />
-        </checksum>
-      </and>
-    </not>
-  </condition>
-       
-  <antcall target="deleteFailedCheckSumTraces"/>
+  <antcall>
+    <target name="checkAnyTraceExists"/>
+    <target name="verifyChecksum"/>
+    <target name="deleteFailedCheckSumTraces"/>
+  </antcall>
   <antcall target="downloadTraceFiles"/>
   <exec executable = "git" failifexecutionfails="false" timeout="20000">
     <arg value = "clone"/>
   <antcall target="extractTraces"/>
 </target>
 
+<target name="checkAnyTraceExists">
+  <pathconvert property="anyTraceExists" setonempty="false" pathsep=" ">
+    <path>
+      <fileset dir="." includes="*.tar.bz2" />
+      <fileset dir="." includes="*.tar.gz" />
+      <fileset dir="." includes="*.zip" />
+    </path>
+  </pathconvert>
+</target>
+
+<target name="verifyChecksum">
+  <echo message="Verifying: ${anyTraceExists}"/>
+  <condition property="failedCheckSum">
+    <and>
+      <isset property="anyTraceExists"/>
+      <not>
+        <and>
+          <checksum>
+            <fileset dir="." includes="*.tar.bz2" />
+            <fileset dir="." includes="*.tar.gz" />
+            <fileset dir="." includes="*.zip" />
+          </checksum>
+        </and>
+      </not>
+    </and>
+  </condition>
+</target>
+
+
 <target name="deleteFailedCheckSumTraces" if="failedCheckSum">
   <echo message="Some traces have failed the checksum tests. Deleting traces."/>
   <delete verbose="true">
@@ -58,7 +79,7 @@
   </delete>
 </target>
 
-<target name="warnFailedCheckSum" if="failedCheckSum2">
+<target name="warnFailedCheckSum" if="failedCheckSum">
   <echo message="WARNING: Some downloaded traces failed the checkum."/>
 </target>
 
 </target>
 
 <target name="extractTraces" if="tracesExist">
-    <condition property="failedCheckSum2">
-      <not>
-        <and>
-          <checksum>
-            <fileset dir="." includes="*.tar.bz2" />
-            <fileset dir="." includes="*.tar.gz" />
-            <fileset dir="." includes="*.zip" />
-          </checksum>
-        </and>
-      </not>
-    </condition>
-    <antcall target="warnFailedCheckSum"/>
+    <antcall>
+      <target name="checkAnyTraceExists"/>
+      <target name="verifyChecksum"/>
+      <target name="warnFailedCheckSum"/>
+    </antcall>
     <bunzip2 src="sample-ctf-trace-20120412.tar.bz2"/>
     <bunzip2 src="trace2.tar.bz2"/>
     <bunzip2 src="kernel_vm.tar.bz2" />
This page took 0.044386 seconds and 5 git commands to generate.