Ant

Wer Apache Ant (http://ant.apache.org) als Buildsystem einsetzt, kann die Testausführung mit QF-Test in die Builddatei integrieren:

<project name="QF-Test" default="runtest">

    <property name="qftest"
	  location="c:\Program Files\qfs\qftest\qftest-7.1.2\bin\qftest.exe" />
    <property name="logdir" value="c:\mylogs" />

    <target name="runtest" description="Run a test in batchmode">
        <echo message="Running ${suite} ..." />
        <exec executable="${qftest}" failonerror="false"
	  resultproperty="returncode">
            <arg value="-batch" />
            <arg value="-compact" />
            <arg value="-runlog" />
            <arg value="${logdir}\+b" />
            <arg value="${suite}" />
        </exec>
        <condition property="result"
	  value="Test terminated successfully.">
            <equals arg1="${returncode}" arg2="0" />
        </condition>
        <condition property="result"
	  value="Test terminated with warnings.">
            <equals arg1="${returncode}" arg2="1" />
        </condition>
        <condition property="result"
	  value="Test terminated with errors.">
           <equals arg1="${returncode}" arg2="2" />
        </condition>
        <condition property="result"
	  value="Test terminated with exceptions.">
            <equals arg1="${returncode}" arg2="3" />
        </condition>
        <echo message="${result}" />
    </target>

</project>
        
Beispiel 27.1:  Ant Builddatei build.xml zur Ausführung einer Testsuite

Im obigen Beispiel wird davon ausgegangen, dass die auszuführende Testsuite beim Aufruf von ant als Property definiert wird: ant -Dsuite="...\qftest-7.1.2\demo\carconfigSwing\carconfigSwing_en.qft".