blob: 3fcbcb2bff0931142a376cedd213911146c3007a [file] [log] [blame]
<?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>