[IronPython] Adding Unit Tests

Dino Viehland dinov at microsoft.com
Tue Jan 11 04:11:30 CET 2011


To add a new test you can modify the %DLR_Root%\Test\IronPython.tests file and add something like:

        <Test>
          <Name>test_csv_cpy</Name>
          <Filename>%DLR_ROOT%\Languages\IronPython\Internal\ipy.bat</Filename>
          <Arguments> Test\test_csv.py</Arguments>
          <MaxDuration>600000</MaxDuration>
          <LongRunning>false</LongRunning>
          <Disabled>false</Disabled>
          <RequiresAdmin>false</RequiresAdmin>
          <NotParallelSafe>false</NotParallelSafe>
          <WorkingDirectory>%DLR_ROOT%\External.LCA_RESTRICTED\Languages\IronPython\27\Lib</WorkingDirectory>
        </Test>

The test runner will then include running those tests.

If you want to add new tests beyond what CPython has you could either add them directly to CPython's test_csv.py or you could create a new test_csv.py in %DLR_ROOT%\Languages\IronPython\Tests.  If you put them in CPython's test_csv I would suggest adding a comment which says it's an additional test as well as submitting the test back to CPython.  The comment is just there so we know what's going on whenever the next merge from CPython has to happen.

We don't have to stick to this test runner BTW - it was just an easy way to export what we were running in our internal gated checkin system which we couldn't publish.  We could export the data to something else or we could update it to something more Linux and OS/X friendly (as they probably don't have cmd.exe to run bat files :)).

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Slide
Sent: Monday, January 10, 2011 6:42 PM
To: Discussion of IronPython
Subject: [IronPython] Adding Unit Tests

As I am developing an implementation of the _csv module that I would eventually like to contribute to the community, what is the best way to add unit tests to the current suite? I have been using the unit test in the CPython sources for the csv module to test my _csv implementation. Is there an easy way to incorporate that into the current unit test setup?

Thanks,

slide

--
slide-o-blog
http://slide-o-blog.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20110111/fa8dc0af/attachment.html>


More information about the Ironpython-users mailing list