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: Rik
Subject: Patch to stop counting missing tests on internal functions
Date: Fri, 09 Oct 2009 10:06:29 -0700

10/8/09

All,

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.

Cheers,
Rik
diff -r f8e2e9fdaa8f test/fntests.m
--- a/test/fntests.m    Thu Oct 08 16:43:05 2009 +0200
+++ b/test/fntests.m    Thu Oct 08 20:56:04 2009 -0700
@@ -145,7 +145,11 @@
        dsk += sk;
        files_with_tests(end+1) = f;
       else
-       files_with_no_tests(end+1) = f;
+       ## Don't count internal functions which are, or should be,
+        ## covered by tests in the functions which call them
+       if (! (length (nm) > 3 && strcmp (nm(1:2), "__")) )
+         files_with_no_tests(end+1) = f;
+       endif
       endif
     endif
   endfor 

reply via email to

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