|
From: | Rik |
Subject: | Re: BIST tests for C++ functions |
Date: | Tue, 15 Dec 2015 12:04:31 -0800 |
On 12/13/2015 09:00 AM,
address@hidden wrote:
I've adjusted my script to find DEFUNX and DEFUN_DLD now. There are now 485 instances of functions that need to be reviewed. Egads!
This one is hard to detect automatically without passing through cpp or something similar. I'd propose to just add a comment marking it as tested. I added a new example to the instructions on the code sprint page -- Example 4 : Function tested elsewhere -- The BIST tests are normally located immediately following the DEFUN block. However this is not always the case. For functions that occur in pairs like set()/get() or load()/save() the tests may be located near just one of the functions. Or the tests may be located in a single block somewhere else. This could be the end of the file, or it could be in a separate test file in the test/ directory. In this case, the function needs only to be marked with an explanation about where the tests reside. For example, in bessel.cc there is a large test block at the end of the file and the code includes a note that begins with '%!#' /* %!# Function besselj is tested along with other bessels at the end of this file */ Alternatively, it may make sense to move the tests to reside next to the function. For example, cputime() does not have tests in data.cc, but it does in test/system.tst. -- End Example 4 --Although 485 untested functions sounds really bad, a lot of them do have some tests somewhere. I think it would be a good idea to move tests from the test directory to reside in the same file as the implementation.
I don't think we need to test functions defined through DEFALIAS. For trivial DEFUNs I would just put a note in the code that the tests for the function reside under the principal name. I've updated the instructions and the list of instances at http://wiki.octave.org/Add_BIST_tests_for_octave_functions_written_in_C%2B%2B#Instances. Since this is a well-defined task I also added it to the Short Projects list in the wiki (http://wiki.octave.org/Short_projects). --Rik |
[Prev in Thread] | Current Thread | [Next in Thread] |