← Back to team overview

kicad-developers team mailing list archive

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

 


On 12/6/2016 11:35 AM, 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.

I'm fine with copying the binaries to a single directory.  It's not very
elegant but it's probably the path of least resistance.  I'm surprised
cmake doesn't have a way to temporarily add build libs for testing
purposes.  Maybe they do and I'm just not aware of it.  Please make sure
you add any necessary hooks to clean up the shared test directory to the
cmake config so as not to leave a bunch of orphaned binaries laying around.

> 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.
> 
> 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


References