ctf: Restore the downloading of the ctf-testsuite
[deliverable/tracecompass.git] / ctf / org.eclipse.tracecompass.ctf.core.tests / traces / get-traces.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3 Copyright (C) 2013, Red Hat, Inc. and others
4
5 All rights reserved. This program and the accompanying materials
6 are made available under the terms of the Eclipse Public License v1.0
7 which accompanies this distribution, and is available at
8 http://www.eclipse.org/legal/epl-v10.html
9 -->
10
11 <project name="Extract Traces" default="main" >
12 <target name="main">
13 <antcall>
14 <target name="checkAnyTraceExists"/>
15 <target name="verifyChecksum"/>
16 <target name="deleteFailedCheckSumTraces"/>
17 </antcall>
18 <antcall target="downloadTraceFiles"/>
19 <exec executable = "git" failifexecutionfails="false" timeout="20000">
20 <arg value = "clone"/>
21 <arg value = "https://github.com/efficios/ctf-testsuite.git"/>
22 </exec>
23 <condition property="testSuiteExists">
24 <and>
25 <available file="ctf-testsuite" type="dir"/>
26 </and>
27 </condition>
28 <antcall target="pullTestSuite"/>
29 <condition property="tracesExist">
30 <and>
31 <available file="synctraces.tar.gz" />
32 </and>
33 </condition>
34 <antcall target="extractTraces"/>
35 </target>
36
37 <target name="checkAnyTraceExists">
38 <pathconvert property="anyTraceExists" setonempty="false" pathsep=" ">
39 <path>
40 <fileset dir="." includes="*.tar.gz" />
41 </path>
42 </pathconvert>
43 </target>
44
45 <target name="verifyChecksum">
46 <echo message="Verifying: ${anyTraceExists}"/>
47 <condition property="failedCheckSum">
48 <and>
49 <isset property="anyTraceExists"/>
50 <not>
51 <and>
52 <checksum>
53 <fileset dir="." includes="*.tar.gz" />
54 </checksum>
55 </and>
56 </not>
57 </and>
58 </condition>
59 </target>
60
61
62 <target name="deleteFailedCheckSumTraces" if="failedCheckSum">
63 <echo message="Some traces have failed the checksum tests. Deleting traces."/>
64 <delete verbose="true">
65 <fileset dir="." includes="*.tar.gz" />
66 </delete>
67 </target>
68
69 <target name="warnFailedCheckSum" if="failedCheckSum">
70 <echo message="WARNING: Some downloaded traces failed the checkum."/>
71 </target>
72
73 <target name="downloadTraceFiles">
74 <echo message="Attempting to download test traces"/>
75 <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="synctraces.tar.gz" src="http://archive.eclipse.org/tracecompass/test-traces/ctf/synctraces.tar.gz" />
76 </target>
77
78 <target name="pullTestSuite" if="testSuiteExists">
79 <!-- Update the local 'master' branch -->
80 <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
81 <arg value = "checkout"/>
82 <arg value = "master"/>
83 </exec>
84 <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
85 <arg value = "pull"/>
86 </exec>
87
88 <!-- Checkout the commit requested by the current build -->
89 <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
90 <arg value = "checkout"/>
91 <arg value = "${ctf-test-suite-commit}"/>
92 </exec>
93 </target>
94
95 <target name="extractTraces" if="tracesExist">
96 <antcall>
97 <target name="checkAnyTraceExists"/>
98 <target name="verifyChecksum"/>
99 <target name="warnFailedCheckSum"/>
100 </antcall>
101 <gunzip src="synctraces.tar.gz" />
102 <untar src="synctraces.tar" dest="." />
103
104 <echo message="Traces extracted successfully"/>
105 </target>
106 </project>
This page took 0.047481 seconds and 5 git commands to generate.