File: get-traces.xml

package info (click to toggle)
eclipse-tracecompass 6.2.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 77,440 kB
  • sloc: java: 316,465; xml: 99,829; perl: 400; sh: 353; makefile: 43; javascript: 29; python: 18
file content (117 lines) | stat: -rw-r--r-- 4,061 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?xml version="1.0" encoding="UTF-8" ?>
<!--
   Copyright (c) 2013, 2019 Red Hat, Inc. and others

   All rights reserved. This program and the accompanying materials
   are made available under the terms of the Eclipse Public License 2.0
   which accompanies this distribution, and is available at
   https://www.eclipse.org/legal/epl-2.0/

   SPDX-License-Identifier: EPL-2.0
-->

<project name="Extract Traces" default="main" >
<target name="main">
  <antcall>
    <target name="checkAnyTraceExists"/>
    <target name="verifyChecksum"/>
    <target name="deleteFailedCheckSumTraces"/>
  </antcall>
  <antcall target="downloadTraceFiles"/>
  <exec executable = "git" failifexecutionfails="false" timeout="20000">
    <arg value = "clone"/>
    <arg value = "https://github.com/efficios/ctf-testsuite.git"/>
  </exec>
  <condition property="testSuiteExists">
    <and>
      <available file="ctf-testsuite" type="dir"/>
    </and>
  </condition>
  <antcall target="pullTestSuite"/>
  <condition property="tracesExist">
    <and>
      <available file="synctraces.tar.gz" />
    </and>
  </condition>
  <antcall target="extractTraces"/>
</target>

<target name="checkAnyTraceExists">
  <pathconvert property="anyTraceExists" setonempty="false" pathsep=" ">
    <path>
      <fileset dir="." includes="*.tar.gz" />
    </path>
  </pathconvert>
</target>

<target name="verifyChecksum">
  <echo message="Verifying: ${anyTraceExists}"/>
  <condition property="failedCheckSum">
    <and>
      <isset property="anyTraceExists"/>
      <not>
        <and>
          <checksum>
            <fileset dir="." includes="*.tar.gz" />
          </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">
    <fileset dir="." includes="*.tar.gz" />
  </delete>
</target>

<target name="warnFailedCheckSum" if="failedCheckSum">
  <echo message="WARNING: Some downloaded traces failed the checkum."/>
</target>

<target name="downloadTraceFiles">
  <echo message="Attempting to download test traces"/>
  <get ignoreerrors="true" maxtime="1200" skipexisting="true" dest="synctraces.tar.gz" src="http://archive.eclipse.org/tracecompass/test-traces/ctf/synctraces.tar.gz" />
  <get ignoreerrors="true" maxtime="1200" skipexisting="true" dest="os-events.tar.gz" src="http://archive.eclipse.org/tracecompass/test-traces/os-events.tar.gz" />
  <get ignoreerrors="true" maxtime="1200" skipexisting="true" dest="qmlscene.tar.gz" src="http://archive.eclipse.org/tracecompass/test-traces/qmlscene.tgz" />
  <get ignoreerrors="true" maxtime="2400" skipexisting="true" dest="vlc.tar.gz" src="http://archive.eclipse.org/tracecompass/test-traces/ctf/vlc.tar.gz" />
</target>

<target name="pullTestSuite" if="testSuiteExists">
  <!-- Update the local 'master' branch -->
  <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
    <arg value = "checkout"/>
    <arg value = "master"/>
  </exec>
  <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
    <arg value = "pull"/>
  </exec>

  <!-- Checkout the commit requested by the current build -->
  <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
    <arg value = "checkout"/>
    <arg value = "${ctf-test-suite-commit}"/>
  </exec>
</target>

<target name="extractTraces" if="tracesExist">
    <antcall>
      <target name="checkAnyTraceExists"/>
      <target name="verifyChecksum"/>
      <target name="warnFailedCheckSum"/>
    </antcall>
    <gunzip src="synctraces.tar.gz" />
    <untar src="synctraces.tar" dest="." />
    <gunzip src="os-events.tar.gz" />
    <untar src="os-events.tar" dest="." />
    <gunzip src="qmlscene.tar.gz" />
    <untar src="qmlscene.tar" dest="." />
    <gunzip src="vlc.tar.gz" />
    <untar src="vlc.tar" dest="." />

    <echo message="Traces extracted successfully"/>
</target>
</project>