Re: [IronPython] Adding Unit Tests
I was wondering how this is progressing. Is there any chance that this could be incorporated into the release of 2.7? This issuehttp://ironpython.codeplex.com/workitem/21395is sitting on 14 votes and it would be great if we could close it. Richard On Tue, Jan 11, 2011 at 2:41 AM, Slide slide.o@gmail.com wrote: 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/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Adding Unit Tests
An interesting thought... MY Linux box has a cmd.exe -- it's part of WINE. But cmd.exe is a very simple shell. How hard would it be to write one in Python? IPython (different from IronPython) IS a shell, if I understand correctly. -- Vernon On Mon, Jan 10, 2011 at 8:11 PM, Dino Viehland di...@microsoft.com wrote: To add a new test you can modify the %DLR_Root%\Test\IronPython.tests file and add something like: Test Nametest_csv_cpy/Name Filename%DLR_ROOT%\Languages\IronPython\Internal\ipy.bat/Filename Arguments Test\test_csv.py/Arguments MaxDuration60/MaxDuration LongRunningfalse/LongRunning Disabledfalse/Disabled RequiresAdminfalse/RequiresAdmin NotParallelSafefalse/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 J). *From:* users-boun...@lists.ironpython.com [mailto: users-boun...@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/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Adding Unit Tests
On Mon, Jan 10, 2011 at 8:11 PM, Dino Viehland di...@microsoft.com wrote: 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 J). Maybe we should just use unittest2 as the test runner, and wire it into the existing one if the IronRuby guys want to keep using it. Besides, I hear Michael knows a little bit about unittest2, so he might be able to help. - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Adding Unit Tests
IronRuby doesn't use the test runner. IronRuby's harness is written in Ruby (Languages\Ruby\Tests\Scripts\irtests.rb). It's run by a previous IronRuby version checked in to Util\IronRuby. Tomas -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Tuesday, January 11, 2011 8:03 AM To: Discussion of IronPython Subject: Re: [IronPython] Adding Unit Tests On Mon, Jan 10, 2011 at 8:11 PM, Dino Viehland di...@microsoft.com wrote: 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 J). Maybe we should just use unittest2 as the test runner, and wire it into the existing one if the IronRuby guys want to keep using it. Besides, I hear Michael knows a little bit about unittest2, so he might be able to help. - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Adding Unit Tests
On Tue, Jan 11, 2011 at 10:22 AM, Tomas Matousek tomas.matou...@microsoft.com wrote: IronRuby doesn't use the test runner. IronRuby's harness is written in Ruby (Languages\Ruby\Tests\Scripts\irtests.rb). It's run by a previous IronRuby version checked in to Util\IronRuby. So is there any value whatsoever in keeping the TestRunner around? If there isn't, I'll look into porting the IronPython test infrastructure to use unittest. - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Adding Unit Tests
Jeff wrote: On Tue, Jan 11, 2011 at 10:22 AM, Tomas Matousek tomas.matou...@microsoft.com wrote: IronRuby doesn't use the test runner. IronRuby's harness is written in Ruby (Languages\Ruby\Tests\Scripts\irtests.rb). It's run by a previous IronRuby version checked in to Util\IronRuby. So is there any value whatsoever in keeping the TestRunner around? If there isn't, I'll look into porting the IronPython test infrastructure to use unittest. As long as all of the tests we want to run keep running there's no reason to keep TestRunner - it was just a way to run all of the same tests we ran before w/o relying upon internal MS infrastructure. I'm not sure how many of the DLR tests we'll still want to run but I imagine we can just wrap them in unittest and have it run the EXEs. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Adding Unit Tests
I've got a pull request https://github.com/IronLanguages/main/pull/7waiting that at least gets the TestRunner to run. It fixes up some bugs and disables some tests in the configuration file where missing directories caused it to crash. Richard On Tue, Jan 11, 2011 at 5:49 PM, Dino Viehland di...@microsoft.com wrote: Jeff wrote: On Tue, Jan 11, 2011 at 10:22 AM, Tomas Matousek tomas.matou...@microsoft.com wrote: IronRuby doesn't use the test runner. IronRuby's harness is written in Ruby (Languages\Ruby\Tests\Scripts\irtests.rb). It's run by a previous IronRuby version checked in to Util\IronRuby. So is there any value whatsoever in keeping the TestRunner around? If there isn't, I'll look into porting the IronPython test infrastructure to use unittest. As long as all of the tests we want to run keep running there's no reason to keep TestRunner - it was just a way to run all of the same tests we ran before w/o relying upon internal MS infrastructure. I'm not sure how many of the DLR tests we'll still want to run but I imagine we can just wrap them in unittest and have it run the EXEs. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Adding Unit Tests
To add a new test you can modify the %DLR_Root%\Test\IronPython.tests file and add something like: Test Nametest_csv_cpy/Name Filename%DLR_ROOT%\Languages\IronPython\Internal\ipy.bat/Filename Arguments Test\test_csv.py/Arguments MaxDuration60/MaxDuration LongRunningfalse/LongRunning Disabledfalse/Disabled RequiresAdminfalse/RequiresAdmin NotParallelSafefalse/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-boun...@lists.ironpython.com [mailto:users-boun...@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/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com