octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch to stop counting missing tests on internal functions


From: John W. Eaton
Subject: Patch to stop counting missing tests on internal functions
Date: Tue, 13 Oct 2009 05:56:53 -0400

On  9-Oct-2009, Rik wrote:

| Currently when a user runs 'make check' there is a report which shows a
| large number of files that don't have tests written for them and then
| invites the user to contribute tests.  On looking through the list,
| however, there are about 60 functions which are for internal use only as
| designated by the prefix and suffix "__".   An example is __contourc__.cc
| 
| My proposed patch to fntests.m would remove these from the report of
| functions missing tests. (This is *only* about reporting.  If tests for
| internal functions have been written they would still continue to be
| run.)  First, if these internal functions need coverage they should get
| it from tests written by the function which calls them.  In the example
| given, there is already a test in contourc.m which presumably would
| catch an error in the internal function.  Secondly, if a user does have
| a few spare moments to write a test for a function we will get more
| value for the coding effort if they concentrate on functions that people
| might use all the time rather than internal ones.
| 
| Thoughts?  If there are no strong objections I'll apply the patch in a
| few days.

I'm not sure that we should stop testing all functions named this way.
The naming scheme was adopted because Octave did not have private
functions or subfunctions, so the functions with names of the form
__X__ which really should be private functions or subfunctions should
be converted.  Then they won't be tested because you can't call
private functions or subfunctions directly, and we could ensure that
the test script does not search private subdirectories.  Then we would
be left with functions that are "internal" in the sense that they do
something special that is not normally useful for programming, but are
occasionally used for debugging or some other purpose.  I'm thinking
of functions like __dump_symtab_info__.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]