← Back to team overview

kicad-developers team mailing list archive

Re: [RFC] [PATCH] simple C++ tests

 

On 12/4/2016 8:53 AM, Michael Steinberg wrote:
> 
> Am 12.09.2016 um 17:14 schrieb Wayne Stambaugh:
>>
>> On 9/12/2016 11:04 AM, Tomasz Wlostowski wrote:
>>> On 08.09.2016 18:49, Wayne Stambaugh wrote:
>>>> Hey Tom,
>>>>
>>>> Here is the patch that fixes the linking as well.  I linked against the
>>>> static libraries.  That shouldn't be an issue.
>>>>
>>> Hi Wayne,
>>>
>>> Thanks for the patch. It looks like the config.h file is generated in
>>> the build directory, not the source one. I was building in-tree so I
>>> didn't notice the problem.
>>>
>>> Concerning static linking, I would like to have an option (say,
>>> KICAD_TESTS_USE_KIFACE_DLLL) to avoid it and link directly to the
>>> .kiface DLL. This results in way faster linking times and omits
>>> dependency calculations, which I find very annoying (especially when I
>>> know I didn't change anything that would result in an incompatible DLL
>>> binary).
>> Linking to the dynamic library in the pcbnew/ build path is problematic.
>>   On linux, you would have to run ldconfig, on windows you would have set
>> the $PATH environment variable, and I believe osx also has some type of
>> dynamic library loader that would require configuration otherwise the
>> tests would fail because the os wont be able to find the dynamic
>> library.  That's why I statically linked it.  I would think that would
>> be acceptable for unit testing purposes.
> Hello all,
> 
> what's the status on this? If I'm rewriting lib stuff I could just as
> well go ahead and add unit tests for it. I couldn't find the "tests"
> folder that would be added by the patch.
> 
> Michael
> 

Michael,

The unit tests are in the qa folder.  As of right now there are only
some python tests using the python unit test framework which means any
code you write would have to be built into the python scripting support
to test it.  We have discussed using the boost unit test framework for
testing c++ code directly so that is an option as well.

Cheers,

Wayne


Follow ups

References