Mailing list - Entries of 2006


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[QF-Test] template for ant-targets for QF-Test 2.0


  • Subject: [QF-Test] template for ant-targets for QF-Test 2.0
  • From: Martin Moser <martin.moser@?.de>
  • Date: Tue, 05 Dec 2006 16:54:49 +0100

Hi all,

as we are asked for support on creating ant-targets for QF-Test/ant integration, I post some template targets for the basic integration of QF-Test in ant.

These targets are only templates and you may have to adapt it to your own concerns. All ant-experienced users are kindly invited to post their solution in this thread, if they want to share their knowledge.



<project>
	
	<!-- properties, used in tasks
	     can be set by setting parameter -DpropertyName=value
	     -->
<property name="testSuite" value="/path/to/test-suite.qft"/> <!-- you have to specify this--> <property name="reportDirectory" value="/path/to/reportdirectory"/> <!-- you have to specify this--> <property name="logDirectory" value="/path/to/logdirectory"/> <!-- you have to specify this-->
	<property name="logName" value="%b-%y%M%d-%h%m%s-%r.qrz"/>
	<property name="reportName" value="%b-%y%M%d-%h%m%s-%r"/>
<property name="pkgdocDirectory" value="/path/to/documentationDirectory"/> <!-- you have to specify this--> <property name="testdocDirectory" value="/path/to/documentationDirectory"/> <!-- you have to specify this-->
	
<!-- setting right qftest-executable to make one ant-file usable for windows and unix --> <condition property="qftest" value="/path/to/qftest.exe"> <!-- you have to specify this-->
		<os family="windows" />
	</condition>
<condition property="qftest" value="/path/to/qftest"> <!-- you have to specify this-->
		<os family="unix" />
	</condition>
	
	
	<!-- test-execution target-->
	<target name="test.run"
		description="run tests"
		unless="tests.failed">
		
		<echo message="Start tests with QF Test"/>
		
		<exec dir="/" executable="${qftest}">
			<arg value="-batch"/>
			<arg value="-report.html"/>
			<arg value="${reportDirectory}"/>
			<arg value="-report.name"/>
			<arg value="${reportName}"/>
			<arg value="-runlog"/>
			<arg value="${logDirectory}/${logName}"/>
			<arg value="${testSuite}"/>
		</exec>
		
		<!-- an alternative command
		
		     <exec dir="/" executable="${qftest}">
<arg line="-batch -report.html ${reportDirectory} -report.name ${reportName} -runlog ${logDirectory}/${logName} ${testSuite}"/>
		     </exec>
		
		-->
		
	</target>
	
	<!-- test and package documentation target-->
	<target name="test.doc"
		description="creates test and package documentation"
		depends="test.pkgdoc,test.testdoc">
	</target>
	
	<!-- package-documentation target -->
	<target name="test.pkgdoc"
		description="creates  package documentation">
		
		<echo message="create package documentation for QF Test, ..."/>
		
		<exec dir="/" executable="${qftest}">
			<arg value="-batch"/>
			<arg value="-gendoc"/>
			<arg value="-pkgdoc"/>
			<arg value="${pkgdocDirectory}"/>
			<arg value="${testSuite}"/>
		</exec>
		
		<!-- an alternative command
		
	 		<exec dir="/" executable="${qftest}">
			    <arg line="-batch -gendoc -pkgdoc ${pkgdocDirectory} ${testSuite}"/>
			</exec>
		
		-->
		
		<echo message="creation finished."/>		
		
	</target>
	
	<!-- test-documentation target -->
	<target name="test.testdoc"
		description="creates test documentation">
		
		<echo message="create test documentation for QF Test, ..."/>
		
		<exec dir="/" executable="${qftest}">
			<arg value="-batch"/>
			<arg value="-gendoc"/>
			<arg value="-testdoc"/>
			<arg value="${testdocDirectory}"/>
			<arg value="${testSuite}"/>
		</exec>
		
		<!-- an alternative command
		
		<exec dir="/" executable="${qftest}">
			<arg line="-batch -gendoc -testdoc ${testdocDirectory} ${testSuite}"/>
		</exec>
		
		-->
		
		<echo message="creation finished."/>
		
	</target>
	
	
</project>



Regards,
Martin

--
Martin Moser                                  Martin.Moser@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919874
DE-82538 Geretsried                          Fax: +49 8171 919876


Videos Downloads Documentation Buy Free Trial