← Back to team overview

dolfin team mailing list archive

Re: Adding tests

 

On Tue, Oct 9, 2012 at 1:11 PM, Andy Ray Terrel <andy.terrel@xxxxxxxxx> wrote:
> On Mon, Oct 8, 2012 at 9:58 PM, Anders Logg <logg@xxxxxxxxx> wrote:
>> On Mon, Oct 08, 2012 at 01:37:58PM -0500, Andy Ray Terrel wrote:
>>> On Mon, Oct 8, 2012 at 1:13 PM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>>> > On Mon, Oct 8, 2012 at 6:42 PM, Andy Ray Terrel <andy.terrel@xxxxxxxxx> wrote:
>>> >> Hello,
>>> >>
>>> >> I've been trying to figure out how to get a test added to the
>>> >> unittests in DOLFIN that cmake will pick up.  Does anyone have any
>>> >> pointers what I have to do after making the unittest source file?
>>> >> Reconfiguring doesn't seem to "just pick it up" as adding source to
>>> >> the dolfin source dir does.
>>> >>
>>> >
>>> > Add the test to
>>> >
>>> >     test/unit/test.py
>>> >
>>> > Garth
>>> >
>>>
>>> Thanks.  FWIW, the file copy worked (probably some cache problem the
>>> first time), but I needed to add the add_executable command to the
>>>
>>> test/unit/mesh/cpp/CMakeLists.txt
>>>
>>> But this file says it's generated by:
>>>
>>> cmake/scripts/generate-cmakefiles
>>>
>>> I don't see that script reading test/unit/test.py so how do I add the
>>> executable stuff?
>>
>> That file is for controlling which tests should be included when the
>> tests are run.
>>
>> But I understand you are talking about C++ unit tests here. Did you
>> run the script? (cmake/scripts/generate-cmakefiles)
>>
>> --
>> Anders
>
> Yes, running the script works.  I should have read it more carefully.
> I had just put all my quad tests into the Mesh test.  Is that
> preferred over splitting out tests?  To be honest, a stricter person
> would require tests on each class but that becomes cumbersome in such
> a large project.
>
> -- Andy


Another question, when a cpp test is changed, the build command
doesn't copy it over to the build directory (like it does for the
source files).  The tests seem only to be copied when the configure is
run.  Is this normal or am I doing something wrong?

-- Andy


Follow ups

References