From: Don C. <dco...@ch...> - 2003-03-17 23:19:35
|
Jeff, This code works great for running tests. I'd like to expand on this theme so I can run it more like the <batchtest> argument to <junit>. We name all out Java test cases *TestCase.java and use a FileSet to find all the test cases in the project path by name. I'd like to use a similar approach for the jython tests. I was considering creating a new loadTests method that took a directory and a file pattern, but that seems a little clunky. It would be nicer to use a FileSet to find *TestCase.py and somehow pass the results to JythonTest. Do you have any ideas on how to implement this? Thanks, Don On Tue, 2003-03-11 at 09:50, Jeff Emanuel wrote: > > We use JUnit from ANT but like to write our tests in Jython using > unittest.py. I've attached some wrapper code that makes Jython > unittest.py-based tests accessible to the ANT JUnit task. Maybe > you will find this useful. > > > Here is my ANT junit task for running the tests defined in > MyTestCase.py: > > <!-- This is a sample to test that we can run unit test written in > Jython--> > <junit fork="yes" printsummary="yes" showoutput="yes"> > <classpath> > <path refid="jython-test-classpath"/> > </classpath> > <formatter type="xml"/> > <sysproperty key="jythontest.modulename" value="MyTestCase"/> > <sysproperty key="jythontest.path" value="${jytestpath}"/> > <sysproperty key="python.home" value="${python.home}" /> > <test name="JythonTest" > todir="${build.test}" > outfile="TEST-MyTestCase" /> > </junit> > |