git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [QGIT RFC] Unit tests for QGit
@ 2008-08-08 21:13 Jan Hudec
  2008-08-08 23:00 ` Benjamin Sergeant
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Jan Hudec @ 2008-08-08 21:13 UTC (permalink / raw)
  To: Marco Costalba; +Cc: git

Hello Marco and others,

I've been thinking about some refactoring of QGit since some time. And to be
sure I don't screw up things too hard in the process, I thought about adding
a test suite infrastructure first (and add some test cases for each think
just before refactoring it).

The problem is, that implementing unittests means I need to compile
2 separate binaries -- qgit itself and the test -- using most (but not all)
of the same sources. I see two ways to do it, so I'd like to ask which you
consider cleaner:

 1. Reorganize stuff so that a (static) library is created from all the
    sources except qgit.cpp and than qgit.cpp is linked to this library to
    create qgit and the tests are linked with it to provide the test runner.

    Pros:
     - The .pro files should remain reasonably simple.
     - The sources are only compiled once.
    Cons:
     - Need to split the src directory to two, so bigger moving stuff around.

 2. Put the list of sources into file included in the src.pro and include it
    in the tests.pro file too.

    Pros:
     - No libraries and stuff
     - Less moving stuff around.
    Cons:
     - The sources actually get compiled twice, once for the tests and once
       for the qgit binary.
     - Paths to the sources need to be manually adjusted after including into
       the .pro files, making the .pro files rather ugly.

There seems to be no solution requiring less changes to the projects, because
qmake can only create one library or executable per directory and including
files from other directory is not supported to well.

I've already done the later (have patch series ready), but I am now thinking
that I should probably redo it the first way. What do you think. Does it make
sense to do that?

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-08-29  7:02 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-08 21:13 [QGIT RFC] Unit tests for QGit Jan Hudec
2008-08-08 23:00 ` Benjamin Sergeant
2008-08-10  7:55   ` Jan Hudec
2008-08-17  8:57 ` Marco Costalba
2008-08-17 14:15   ` Jan Hudec
2008-08-17 15:46 ` Marco Costalba
2008-08-17 19:58   ` Jan Hudec
2008-08-17 20:30     ` Marco Costalba
2008-08-18 18:00       ` Jan Hudec
2008-08-19 14:53         ` Marco Costalba
2008-08-27 20:18           ` Jan Hudec
2008-08-28 11:29             ` Marco Costalba
2008-08-28 15:31               ` Karl Hasselström
2008-08-28 18:54                 ` Marco Costalba
2008-08-28 22:01                   ` Jan Hudec
2008-08-29  7:01                     ` Marco Costalba
2008-08-28 22:18                   ` Karl Hasselström

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).