Ticket #1114 (closed cage: done)

Opened 12 years ago

Last modified 12 years ago

[patch] Converted some tests from perl to pir

Reported by: mgrimes Owned by: dukeleto
Priority: minor Milestone:
Component: testing Version: trunk
Severity: low Keywords:
Cc: Language:
Patch status: applied Platform: all

Description

The attached patch converts the following files from perl to pir:

t/op/arithmetics_pmc.t
t/op/arithmetics.t
t/op/64bit.t

-Mark

Attachments

perl_to_pir.patch Download (33.4 KB) - added by mgrimes 12 years ago.
perl_to_pir_v2.patch Download (160.2 KB) - added by mgrimes 12 years ago.
arithmetics.t.patch Download (411 bytes) - added by mgrimes 12 years ago.
gen_arithmetics_pmc.pl.patch Download (1.4 KB) - added by mgrimes 12 years ago.
gen_string_cmp.pl.patch Download (4.2 KB) - added by mgrimes 12 years ago.

Change History

Changed 12 years ago by mgrimes

Changed 12 years ago by mgrimes

I have now converted t/op/string.t to pir. I also added comments to the TAP output for the first three. Please use perl_to_pir_v2.patch rather than the parl_to_pir.patch.

string.t has a number of tests to check the comparison ops, that were generated by perl code. I have moved these tests to t/op/string_cmp.t. They are now pure pir, but I included (in a comments to string_cmp.t) the code that was used to generate it.

Hope these are helpful.

I have also put together a perl script and a some vim macros that helped streamline the conversion. It is pretty ugly code, but it really helped. If anyone else is interested I'm happy to share the code. Alternatively, if there is an appropriate place to post the code, I would be happy to do that (it is way to kludgy to release on CPAN, etc).

BTW, on my box, these tests now take about a third of a second to run while they used to take nearly 4.3 seconds. If we collectively run these 900 times, it would save an hour of developer time. :)

-Mark

Changed 12 years ago by mgrimes

Changed 12 years ago by dukeleto

  • owner set to dukeleto
  • platform set to all
  • status changed from new to assigned

I am testing out the patch now.

Changed 12 years ago by dukeleto

I got a "make fulltest" to pass, so I am cleaning up the patch a bit and will commit soon.

I would say that the perl script used could be put in tools/dev and the vim macros could be put in editor/ . I will be removing the perl script from the end of the test file.

Changed 12 years ago by dukeleto

The code that generates t/op/string_cmp.t should be put in as a script in tools/dev/

Changed 12 years ago by dukeleto

Patch applied with slight tweaking at r41906, great work mgrimes++! In the future, if you could make seperate patches for each file that is rewritten, it would make it easier to work with.

The scripts used to generate some of the tests still need to be added to tools/dev, so I will leave the ticket open for now.

Changed 12 years ago by mgrimes

I just saw a bug in my prior patch for t/op/arithmetics.t. I had the wrong type defined for configgmp?. I'm attaching a patch that fixes it (arithmetics.t.patch).

I am also attaching patches that will create the perl files that were used to generate some of the pir tests:

tools/dev/gen_arithmetics_pmc.pl tools/dev/gen_string_cmp.pl

-Mark

Changed 12 years ago by mgrimes

Changed 12 years ago by mgrimes

Changed 12 years ago by mgrimes

Changed 12 years ago by dukeleto

  • status changed from assigned to closed
  • resolution set to done
  • patch changed from new to applied

I think the scripts used to generate the tests will not be added, so I am closing this ticket.

Note: See TracTickets for help on using tickets.