c9db9d0fbb2afcaed451d867504ae5fb3c6f3e2f
[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 <get ignoreerrors="true" maxtime="120" skipexisting="true" dest="os-events.tar.gz" src="http://archive.eclipse.org/tracecompass/test-traces/os-events.tar.gz" />
77 </target>
78
79 <target name="pullTestSuite" if="testSuiteExists">
80 <!-- Update the local 'master' branch -->
81 <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
82 <arg value = "checkout"/>
83 <arg value = "master"/>
84 </exec>
85 <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
86 <arg value = "pull"/>
87 </exec>
88
89 <!-- Checkout the commit requested by the current build -->
90 <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
91 <arg value = "checkout"/>
92 <arg value = "${ctf-test-suite-commit}"/>
93 </exec>
94 </target>
95
96 <target name="extractTraces" if="tracesExist">
97 <antcall>
98 <target name="checkAnyTraceExists"/>
99 <target name="verifyChecksum"/>
100 <target name="warnFailedCheckSum"/>
101 </antcall>
102 <gunzip src="synctraces.tar.gz" />
103 <untar src="synctraces.tar" dest="." />
104 <gunzip src="os-events.tar.gz" />
105 <untar src="os-events.tar" dest="." />
106
107 <echo message="Traces extracted successfully"/>
108 </target>
109 </project>
This page took 0.033798 seconds and 5 git commands to generate.