Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Jul 11, 2011
1 parent 499c9e2 commit e390f47
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 68 deletions.
2 changes: 1 addition & 1 deletion blog_posts/tpf/Makefile
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@




html: html:
for i in *.md; do markdown $$i >> $$i.html; done for i in *.md; do markdown $$i > $$i.html; done
60 changes: 0 additions & 60 deletions blog_posts/tpf/TPF_grant_update_6.md.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -58,63 +58,3 @@ <h2>Grant Refactoring</h2>
definite, I plan to be done with this grant work by July 15th.</p> definite, I plan to be done with this grant work by July 15th.</p>


<p>This is the home stretch! I can feel it in my bones.</p> <p>This is the home stretch! I can feel it in my bones.</p>
<h1>Yet Another TPF Parrot Embed/Extend Grant Update</h1>

<p>I am excited to announce that I have completed my next grant milestone! I
recently increased test coverage of extend_vtable.c to over 95% (
<a href="http://tapir2.ro.vutbr.cz/cover/latest-c_cover/src-extend_vtable-c.html">95.5%</a> to be
exact), achieving the milestone with a half percent buffer. It definitely
wasn't easy, but I changed the way I was approaching writing tests and it
resulted in a <a href="https://github.com/parrot/parrot/compare/5dd8c543ab...8c04cc3e66">huge burst of
productivity</a>.</p>

<p>I went through a test coverage report and wrote down, on an actual piece of
<em>paper</em>, every function that had no test coverage. This allowed me to circle
the functions that I thought would be easiest to write tests for, and quickly
got those out of the way. I then went for uncovered functions that were similar
to already covered functions, and then finally I got to the hard functions.</p>

<p>This was a fruitful exercise, because it was decided by Parrot developers that
some VTABLE functions escaped accidentally and that they should be removed from the public API.
Whiteknight++ <a href="https://github.com/parrot/parrot/commit/cbfc76e64acf9f0a526b5f7da0e4c6c4ec0d1189">removed Parrot_PMC_destroy (extra points for humor)</a>, which I was using incorrectly in the
extend_vtable tests and which was actually coredumping Parrot, but only on certain
platforms. I then removed <a href="https://github.com/parrot/parrot/commit/cd1edef38c9f7d4af8ec3229fa166e4fe92d21f6">Parrot_PMC_mark</a> and <a href="https://github.com/parrot/parrot/commit/44a9634f2764ccccfd7a5cbad1552159fc73bff8">Parrot_PMC_invoke</a>, the first being
an implementation detail of the garbage collector, and Parrot_PMC_invoke because
it was the only function that returned a '''Parrot_Opcode_t*''' and basically
not fit for public consumption.</p>

<p>I also <a href="http://trac.parrot.org/parrot/ticket/2126">created a ticket (TT#2126)</a>
for a bug in the Parrot_PMC_morph function, which
has some possibly buggy but definitely unspecified behavior.</p>

<p>The remaining, untested functions in extend_vtable are clone_pmc, cmp_pmc,
get_pointer_keyed_int, get_pointer_keyed_str, remove_vtable_override,
set_pointer_keyed and set_pointer_keyed_str. I leave the testing of these
functions as an exercise to the interested reader :)</p>

<h2>Grant Refactoring</h2>

<p>This reminds me of a saying, I can't remember it exactly, but it is something
about the best laid plans of camels and butterflies often taste like onions.
Anyway, since I wrote my grant, the Parrot Embed API was deprecated and replaced
with a shinier and better documented system. After talking with cotto++ and
whiteknight++ on IRC, it was decided that working on test coverage for the new
embed API was a better use of resources than writing tests for the old embed
API that my original grant referred to, which will most likely be removed from
Parrot soon.</p>

<p>The new embed API is called <a href="https://github.com/parrot/parrot/blob/master/src/embed/api.c">src/embed/api.c</a>
and the plan is to replace my grant milestone of 95% coverage of embed.c with 95% coverage
of embed/api.c, which is currently at <a href="http://tapir2.ro.vutbr.cz/cover/latest-c_cover/src-embed-api-c.html">72%</a> coverage.</p>

<p>To summarize, I have two grant milestones left, increasing extend.c (currently
at <a href="http://tapir2.ro.vutbr.cz/cover/latest-c_cover/src-extend-c.html">61%</a> )
and embed/api.c to 95% coverage.</p>

<p>Given the lessons learned from testing extend_vtable and based on the fact that
I have already <a href="https://github.com/parrot/parrot/commit/b59b869c9dd6f51109aa41e495082e09844ba348">made some
headway</a>,
my new estimate for these milestones is three weeks each. To make this more
definite, I plan to be done with this grant work by July 15th.</p>

<p>This is the home stretch! I can feel it in my bones.</p>
7 changes: 3 additions & 4 deletions blog_posts/tpf/TPF_grant_update_7.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
## Really TLDR: The Parrot has landed. ## Really TLDR: The Parrot has landed.


It brings me great joy to announce that I have completed all milestones for my It brings me great joy to announce that I have completed all milestones for my
[TPF](http://perlfoundation.org) [grant regarding the Parrot Embed/Extend subsystems] [TPF](http://perlfoundation.org) grant regarding the Parrot [Embed/Extend subsystems](http://news.perlfoundation.org/2010/11/2010q4-grant-proposal-improve.html)!
(http://news.perlfoundation.org/2010/11/2010q4-grant-proposal-improve.html)!
Not only that, but all of my grant work was included in the most recent release of Not only that, but all of my grant work was included in the most recent release of
Parrot, [3.5.0 "Menelaus"](http://parrot.org/news/2011/Parrot-3.5.0). Parrot, [3.5.0 "Menelaus"](http://parrot.org/news/2011/Parrot-3.5.0).


Expand All @@ -26,7 +25,7 @@ with adding code coverage a few rarely-if-ever-used C functions in Parrot's
embed/exted subsystem, which allows you embed Parrot into other applications embed/exted subsystem, which allows you embed Parrot into other applications
and other funky stuff. and other funky stuff.


[Whiteknight++](http://whiteknight.blogspot.com) greatly helped me write a test for [Parrot_sub_new_from_c_func](https://github.com/parrot/parrot/blob/master/src/extend.c#L700) which [Whiteknight++](http://whiteknight.github.com) greatly helped me write a test for [Parrot\_sub\_new\_from\_c\_func](https://github.com/parrot/parrot/blob/master/src/extend.c#L700) which
takes a C function and a string that describes the function signature of the C takes a C function and a string that describes the function signature of the C
function and returns a [NCI PMC](https://github.com/parrot/parrot/blob/master/src/pmc/nci.pmc), which can be invoked. function and returns a [NCI PMC](https://github.com/parrot/parrot/blob/master/src/pmc/nci.pmc), which can be invoked.


Expand All @@ -44,7 +43,7 @@ competition.


I noticed that a large portion (about 80%) of the uncovered code in one file I noticed that a large portion (about 80%) of the uncovered code in one file
was a macro that was copy-and-pasted into two places. I refactored this into a was a macro that was copy-and-pasted into two places. I refactored this into a
single macro called [POP_CONTEXT](https://github.com/parrot/parrot/blob/master/src/extend.c#L331), which reduced the total number of lines in the file by single macro called [POP\_CONTEXT](https://github.com/parrot/parrot/blob/master/src/extend.c#L331), which reduced the total number of lines in the file by
roughly 10, while simultaneously decreased the number of uncoverd lines in the roughly 10, while simultaneously decreased the number of uncoverd lines in the
file by ~20 lines, which had a combined effect of pushing the code coverage file by ~20 lines, which had a combined effect of pushing the code coverage
over the necessary 95% mark. over the necessary 95% mark.
Expand Down
5 changes: 2 additions & 3 deletions blog_posts/tpf/TPF_grant_update_7.md.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ <h1>A Final TPF Parrot Embed/Extend Grant Update</h1>
<h2>Really TLDR: The Parrot has landed.</h2> <h2>Really TLDR: The Parrot has landed.</h2>


<p>It brings me great joy to announce that I have completed all milestones for my <p>It brings me great joy to announce that I have completed all milestones for my
<a href="http://perlfoundation.org">TPF</a> [grant regarding the Parrot Embed/Extend subsystems] <a href="http://perlfoundation.org">TPF</a> grant regarding the Parrot <a href="http://news.perlfoundation.org/2010/11/2010q4-grant-proposal-improve.html">Embed/Extend subsystems</a>!
(http://news.perlfoundation.org/2010/11/2010q4-grant-proposal-improve.html)!
Not only that, but all of my grant work was included in the most recent release of Not only that, but all of my grant work was included in the most recent release of
Parrot, <a href="http://parrot.org/news/2011/Parrot-3.5.0">3.5.0 "Menelaus"</a>.</p> Parrot, <a href="http://parrot.org/news/2011/Parrot-3.5.0">3.5.0 "Menelaus"</a>.</p>


Expand All @@ -26,7 +25,7 @@ <h2>The Deets</h2>
embed/exted subsystem, which allows you embed Parrot into other applications embed/exted subsystem, which allows you embed Parrot into other applications
and other funky stuff.</p> and other funky stuff.</p>


<p><a href="http://whiteknight.blogspot.com">Whiteknight++</a> greatly helped me write a test for <a href="https://github.com/parrot/parrot/blob/master/src/extend.c#L700">Parrot<em>sub</em>new<em>from</em>c_func</a> which <p><a href="http://whiteknight.blogspot.com">Whiteknight++</a> greatly helped me write a test for <a href="https://github.com/parrot/parrot/blob/master/src/extend.c#L700">Parrot_sub_new_from_c_func</a> which
takes a C function and a string that describes the function signature of the C takes a C function and a string that describes the function signature of the C
function and returns a <a href="https://github.com/parrot/parrot/blob/master/src/pmc/nci.pmc">NCI PMC</a>, which can be invoked.</p> function and returns a <a href="https://github.com/parrot/parrot/blob/master/src/pmc/nci.pmc">NCI PMC</a>, which can be invoked.</p>


Expand Down

0 comments on commit e390f47

Please sign in to comment.