--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
ant runtest -Dtest-class=path.to.FooTest
<target name="runtest" description="Run a single test"><fail unless="test-class" message="Property not set: 'test-class'"/><echo message=" -- Running single test --"/><echo message=" -- ${test-class} --" /><testng classpathref="run.cp"outputdir="${testng.report.dir}"><classfileset includesfile="${test-class}"/><jvmarg value="-Dtest.resources.dir=${test.resources.dir}" /></testng></target>
[testng] You need to specify at least one testng.xml, one class or one method[testng] Usage: <main class> [options][testng] -testclass The list of test classes
<jvmarg line="-verbose -testclass com.foo.NewTest" />
[testng] Could not create the Java virtual machine.[testng] Unrecognized option: -testclass
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
Hi,
I have many tests in my test suite but if I want to run a specific
test using Ant, how do I do it?
<testng outputdir="${testng.report.dir}"
classpathref="run.cp"
useDefaultListeners="false"
methods="test.sample.Sample2.method1,test.sample.Sample2.method3">
Hi Dinesh,It is kind of strange, I might be totally incorrect.<target name="runtest" depends="compile" description="Run a single test"><fail unless="testclass" message="Property not set: 'testclass'"/><echo message=" -- Running single test --"/><echo message=" -- ${testclass} --" /><testng classpathref="run.cp" outputdir="test-reports"><jvmarg value="-Dtest.resources.dir=test-resources" /><classfileset includesfile="${testclass}" dir="." /></testng></target>
I was trying it out, and for some reason, when I specified <classfileset includesfile="${testclass}" dir="." /> it invoked something then spit out the command line saying:[testng] You need to specify at least one testng.xml, one class or one method[testng] Usage: <main class> [options][testng] -testclass The list of test classes
Then, I added that:<jvmarg line="-verbose -testclass com.foo.NewTest" />But it spits out (verbose works):[testng] Could not create the Java virtual machine.[testng] Unrecognized option: -testclass