octave-maintainers
[Top][All Lists]
Advanced

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

Re: Testing functions in ./private subdirectory


From: John W. Eaton
Subject: Re: Testing functions in ./private subdirectory
Date: Thu, 18 Apr 2013 22:27:11 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11

On 04/18/2013 03:20 PM, PhilipNienhuis wrote:
Given this discussion:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672756 [1]

and as a corollary of [1], this bug report:
http://savannah.gnu.org/bugs/index.php?38755 [2]

about failure to run tests in functions scripts in ./private subdirectories
for Octave-Forge packages, I was wondering if this issue has ever been
considered in some detail by the Octave developers community before.

A. IMO it is quite useful to have tests for functions living in ./private
subdirs as well, also for OF packages.

B. Indeed, when functions live in ./private directories, they're not in the
PATH and a test script won't find them (obviously, provided that the
testscript is written so that it'll only look in the PATH).

In [1] and [2] it is suggested to move test blocks of functions in ./private
to other functions in the ./inst directory (we're talking about OF here).
I'm less inclined to be in favor of this, as I think tests should be kept
together in one place with the function they're supposed to test. IMO,
having bits and pieces of functions scattered around various places doesn't
help keeping code transparent and easy to manage.

I would rather think it more logical for a test script to temporarily extend
the PATH with ./private subdirs if it finds those.

Now the Debian devs asked me to apply their solution (=moving test blocks)
to functions in the ./private subdir of the io package so that the tests for
those ./private/<functions>  can be run by their test script.
I'm hesitating because I think it's rather their test script that has to be
improved to look in ./private subdirs as well. And maybe/probably for core
Octave a solution already exists (? I think so)

So:  what's the opinion of the Octave devs?

Private functions serve the same purpose as subfunctions.  The only
real difference is that the scope of private functions is any function
in the parent directory instead of just a single parent function.

Would you also propose to strip out the subfunctions and test them
individually?

I don't think either of those things is necessary.  It seems
good enough to me to test only the main functions and to write those
tests in a way that also tests the internal functions.

jwe


reply via email to

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