From: Jason S. <jas...@gm...> - 2008-04-26 10:52:36
|
Hey William and Robert, 2008/4/26 Robert Stone <ta...@tr...>: > Alright, I didn't realize the testcases were not considered > comprehensive for Perl. It's not hard to flesh them out, so I'll spend > some time on that first and hopefully learn a few things about Swig in > the process. William I have a question about the Perl test cases. When I started adding new test cases I began using Test::More to provide a more intuitive process for people already familiar with Perl test cases and Test::Harness. I noticed recently in the test cases there is the following: # Workaround for # ok( not (expression) , "test description" ); # does not working in older versions of Perl, eg 5.004_04 sub ok_not ($;$) { my($test, $name) = @_; $test = not $test; ok($test, $name); } I am concerned that this may be un-necessary or that it may be a difficult to maintain fix. First - I'm not understanding why SWIG needs to support running the test-suite for perl 5.004... This is ancient ancient code. And especially with a discussion happening to make directors work for Perl and moving the shadow classes into C++ - I feel nervous having to support an API that is more than 10 years old... The other way that may fix this is that many tests need to be run inside parens to avoid precedence problems. For example: ok(($op == $op2), "operator equal: equal"); instead of: ok($op == $op2, "operator equal: equal"); So the safest practice is to include a paren around each test, and I believe that will work for not_ok(): ok((not (expression)), "some test"); Also, as I've updated the tests to use Test::More, I have added them to the README in Examples/test_suite/perl5/README. Cheers, jas. |
From: William S F. <ws...@fu...> - 2008-04-28 22:39:41
|
Jason Stewart wrote: > Hey William and Robert, > > 2008/4/26 Robert Stone <ta...@tr...>: > >> Alright, I didn't realize the testcases were not considered >> comprehensive for Perl. It's not hard to flesh them out, so I'll spend >> some time on that first and hopefully learn a few things about Swig in >> the process. > > William I have a question about the Perl test cases. > > When I started adding new test cases I began using Test::More to > provide a more intuitive process for people already familiar with Perl > test cases and Test::Harness. > > I noticed recently in the test cases there is the following: > > # Workaround for > # ok( not (expression) , "test description" ); > # does not working in older versions of Perl, eg 5.004_04 > sub ok_not ($;$) { > my($test, $name) = @_; > $test = not $test; > ok($test, $name); > } > > I am concerned that this may be un-necessary or that it may be a > difficult to maintain fix. > > First - I'm not understanding why SWIG needs to support running the > test-suite for perl 5.004... This is ancient ancient code. And > especially with a discussion happening to make directors work for Perl > and moving the shadow classes into C++ - I feel nervous having to > support an API that is more than 10 years old... > > The other way that may fix this is that many tests need to be run > inside parens to avoid precedence problems. For example: > > ok(($op == $op2), "operator equal: equal"); > > instead of: > > ok($op == $op2, "operator equal: equal"); > > So the safest practice is to include a paren around each test, and I > believe that will work for not_ok(): > > ok((not (expression)), "some test"); > > Also, as I've updated the tests to use Test::More, I have added them > to the README in Examples/test_suite/perl5/README. > > Cheers, jas. > > I guess Perl 5.004 was brand new when SWIG started way back when and it has been supported ever since. I think it is reasonable to drop support for old versions of Perl if it is going to hamper new development. If an old version of Perl is really needed, an old version of SWIG will have to be used. I'm not a Perl expert, but unless there are any objections, you can drop the 5.004 support if any changes are made such that it no longer works. Be sure to document it in the CHANGES file though. William |
From: Jason S. <jas...@gm...> - 2008-04-29 12:11:52
|
Hey William, 2008/4/29 William S Fulton <ws...@fu...>: > I guess Perl 5.004 was brand new when SWIG started way back when and it has > been supported ever since. I think it is reasonable to drop support for old > versions of Perl if it is going to hamper new development. If an old version > of Perl is really needed, an old version of SWIG will have to be used. I'm > not a Perl expert, but unless there are any objections, you can drop the > 5.004 support if any changes are made such that it no longer works. Be sure > to document it in the CHANGES file though. This seems extremely reasonable to me. Perl 5.10 is the current version - and has been out for some time. Perl 5.8.8 is what ships with Ubuntu and Debian. I would recommend the current version of SWIG promising support for 5.8+ - especially because all versions of Perl 5.6 and earlier had broken UTF8 support. Just a thought. Cheers, jas. |
From: Robert S. <ta...@tr...> - 2008-04-29 01:10:23
|
On Sat, Apr 26, 2008 at 04:22:28PM +0530, Jason Stewart wrote: > > When I started adding new test cases I began using Test::More to > provide a more intuitive process for people already familiar with Perl > test cases and Test::Harness. > I did in fact spend the weekend porting testcases, and in addition to pulling in more tests, converted most of the existing tests to Test::More. Speaking of which, when my wrists have reached their limit, where should I drop the patch? > First - I'm not understanding why SWIG needs to support running the > test-suite for perl 5.004... This is ancient ancient code. And > especially with a discussion happening to make directors work for Perl > and moving the shadow classes into C++ - I feel nervous having to > support an API that is more than 10 years old... > I'm curious how far we want support to go back as well so I know how much api drift is an issue in the XS api (threading and Unicode support have seen a lot of drift for example). As for my 2 cents, it seems like if someone wants to use SWIG with a legacy version of an interpreter, they would find it reasonable to need an older version of SWIG too as long as documentation makes that reasonably clear (perhaps compile time checks dropped into the wrapper would be worthwhile as well if it can refer them to those docs on failure). -Robert |
From: Jason S. <jas...@gm...> - 2008-04-29 12:14:44
|
Hey Robert, 2008/4/29 Robert Stone <ta...@tr...>: > I did in fact spend the weekend porting testcases, and in > addition to pulling in more tests, converted most of the existing tests > to Test::More. Speaking of which, when my wrists have reached their > limit, where should I drop the patch? Post it on SF as a patch and I'll add it. Thanks! > As for my 2 cents, it seems like if someone wants to use SWIG > with a legacy version of an interpreter, they would find it reasonable > to need an older version of SWIG too as long as documentation makes that > reasonably clear (perhaps compile time checks dropped into the wrapper > would be worthwhile as well if it can refer them to those docs on > failure). Yeah, we could certainly throw in a warning - that the code is not guaranteed to compile. In the test_suite we could add a 'require 5.8;' so that the tests will give an error with outdated perl versions. Cheers, jas. |
From: William S F. <ws...@fu...> - 2008-04-29 17:57:41
|
Robert Stone wrote: > On Sat, Apr 26, 2008 at 04:22:28PM +0530, Jason Stewart wrote: >> When I started adding new test cases I began using Test::More to >> provide a more intuitive process for people already familiar with Perl >> test cases and Test::Harness. >> > I did in fact spend the weekend porting testcases, and in > addition to pulling in more tests, converted most of the existing tests > to Test::More. Speaking of which, when my wrists have reached their > limit, where should I drop the patch? > Given that you've put in a pretty comprehensive patch for directors along with testcases and now you're working on these additional runtime tests, I'm quite happy to give you svn access so that you can commit them directly. I'm quite happy for you to help maintain the Perl module if you're interested, I'm sure Jason can do with some help. >> First - I'm not understanding why SWIG needs to support running the >> test-suite for perl 5.004... This is ancient ancient code. And >> especially with a discussion happening to make directors work for Perl >> and moving the shadow classes into C++ - I feel nervous having to >> support an API that is more than 10 years old... >> > I'm curious how far we want support to go back as well so I know > how much api drift is an issue in the XS api (threading and > Unicode support have seen a lot of drift for example). > As far back as possible without causing too much of a headache in maintaining the latest versions. > As for my 2 cents, it seems like if someone wants to use SWIG > with a legacy version of an interpreter, they would find it reasonable > to need an older version of SWIG too as long as documentation makes that > reasonably clear (perhaps compile time checks dropped into the wrapper > would be worthwhile as well if it can refer them to those docs on > failure). A compile time check in the wrapper would be very useful, if not vital. William |
From: Jason S. <jas...@gm...> - 2008-04-30 13:32:45
|
Hey Robert and William, 2008/4/29 William S Fulton <ws...@fu...>: > Given that you've put in a pretty comprehensive patch for directors > along with testcases and now you're working on these additional runtime > tests, I'm quite happy to give you svn access so that you can commit > them directly. I'm quite happy for you to help maintain the Perl module > if you're interested, I'm sure Jason can do with some help. That gets a big +1 from me! I haven't done much 'maintenance' in a long time... So all help is good. Cheers, jas. |
From: Robert S. <ta...@tr...> - 2008-04-30 18:29:22
|
On Wed, Apr 30, 2008 at 02:59:59PM +0530, Jason Stewart wrote: > Hey Robert and William, > > 2008/4/29 William S Fulton <ws...@fu...>: > > > Given that you've put in a pretty comprehensive patch for directors > > along with testcases and now you're working on these additional runtime > > tests, I'm quite happy to give you svn access so that you can commit > > them directly. I'm quite happy for you to help maintain the Perl module > > if you're interested, I'm sure Jason can do with some help. > > That gets a big +1 from me! I haven't done much 'maintenance' in a > long time... So all help is good. > If Jason doesn't mind having another hand in that code, then I'd be happy to work directly on the tree. That won't get me off both your backs for code review though. ;) As for the director work, I'll keep working towards a beta quality patch since we think the work so far is on the right track. -Robert |
From: William S F. <ws...@fu...> - 2008-04-30 20:05:09
|
Robert Stone wrote: > On Wed, Apr 30, 2008 at 02:59:59PM +0530, Jason Stewart wrote: >> Hey Robert and William, >> >> 2008/4/29 William S Fulton <ws...@fu...>: >> >>> Given that you've put in a pretty comprehensive patch for directors >>> along with testcases and now you're working on these additional runtime >>> tests, I'm quite happy to give you svn access so that you can commit >>> them directly. I'm quite happy for you to help maintain the Perl module >>> if you're interested, I'm sure Jason can do with some help. >> That gets a big +1 from me! I haven't done much 'maintenance' in a >> long time... So all help is good. >> > If Jason doesn't mind having another hand in that code, then I'd > be happy to work directly on the tree. That won't get me off both your > backs for code review though. ;) > As for the director work, I'll keep working towards a beta > quality patch since we think the work so far is on the right track. > Feel free to set up a branch in svn while you develop this, then merge to trunk when it is ready for release. William |