← Back to team overview

kicad-developers team mailing list archive

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

 

On 12/7/2016 4:29 AM, Maciej Sumiński wrote:
> Hi Michael,
> 
> On 12/06/2016 05:35 PM, Michael Steinberg wrote:
>> Hello,
>>
>> I played around a bit and settled on a quick&easy solution. For running
>> the tests on windows binding to the shared libs is a problem with our
>> default build, because we have separate output directories per target.
>> Only after an install operation are they in one directory for proper
>> library lookup. So I added an option to the kicad cmake script to output
>> all targets to a single shared directory, this option is implicitly
>> activated when unit tests are enabled on windows. It then also adds the
>> boost.test dependency.
> 
> It sounds ok, I do not know how else it could be solved on Windows, at
> least to be able to easily set up automatic testing.
> 
>> Everything else is just like I described in the last message: CTest can
>> be used to run all the test executables, if you want boost.test
>> verbosity, you can always run the tests from the command prompt.
>>
>> Problem left would then be, how we set up the test targets. My initial
>> thought would be to have one target per lib/executable. All tests
>> related to the common library would then be combined to the
>> "common-test" target for example.
> 
> I used to work with projects that had multiple small unit tests and it
> was quite neat solution. Do you think it would be much harder to apply
> the same rules here? If so, I would not mind having one-to-one relation
> between targets and tests, especially that one can easily separate tests
> using boost.test judging from the screenshot you posted.

I would like finer test granularity as well.  It would also be nice if
tests could be grouped so that you could run say all of the tests on
libcommon as a group or each individual test within the libcommon group.
 I don't know if boost::unit_test supports this but if it does that
would be a good thing to implement.

> 
> Regards,
> Orson
> 
>> Here's a screenshot for the targets, RUN_TESTS (CTest) output,
>> boost.test output and the shared stage dir:
>> https://s17.postimg.org/p5ktjhoe5/kicad_unit_tests.png
>>
>> Am I making any sense? I might not be aware of all the things you expect
>> from this.
>>
>> Michael
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


Follow ups

References