On Thursday 12 November 2015 18:41:19 Chris Cannam wrote:
> 
> I'm inclined to think of a unit test as another application built using
> the same code but happening to have a different entry point. You don't
> have to have libraries to do that, still less shared ones, but if you do
> use static libraries, it's still not all that complicated to do.

I have never seen unittests being fully part of the one big monolithic
application and ran with a command-line argument... but indeed
that would be one possibility I suppose. However this isn't how
QTestLib does it, so it would require more structural work and it would
raise the barrier of entry for anyone who is used to QTestLib. It also
leads to linking and loading a much bigger binary when working.
The whole benefit of small executables for unit tests is that they make
test driven development and bisecting much faster.

On Thursday 12 November 2015 16:54:49 D. Michael McIntyre wrote:
> I hadn't thought about that.  The ability to run Rosegarden from any 
> random source directory, without installing any version of it, is 
> ridiculously useful. 

OK then we could go for static libraries, to preserve that.

Anyway I like incremental changes so my plan is
1) build with cmake exactly what is being built now
2) make one big static library with everything except main()
3) write a first unit test

Unfortunately one-big-static-lib means every test will take a long time
to link, so building the tests would have to be off by default otherwise
you guys will get slowed down during development.

I suppose the best of both worlds would be supporting two modes:
* without unit tests enabled, one static lib, one executable
* with unit tests enabled, one shared lib, N executables

cmake definitely makes this possible.

BTW another major advantage of a buildsystem like cmake is that you'll
be able to (more easily) use KDevelop or QtCreator to hack on the code.
For now I generated a fake .pro file to be able to use QtCreator, 
(and then telling qtcreator to never run qmake) but that's a hack.

-- 
David Faure, [email protected], http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to