git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [QGIT RFC] Unit tests for QGit

From
JHJan Hudec <bulb@ucw.cz>
Date
Aug 10, 2008, 07:55 UTC
Message-ID
<20080810075557.GA3955@efreet.light.src>
In-Reply-To
<1621f9fa0808081600i51bcaaedtc22a7a85947ba400@mail.gmail.com>
On Fri, Aug 08, 2008 at 16:00:57 -0700, Benjamin Sergeant wrote:
Show 13 quoted lines
> On Fri, Aug 8, 2008 at 2:13 PM, Jan Hudec <bulb@ucw.cz> wrote:
> > 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:
> > [...]
> 
> Maybe you can have a look at QTestLib. But it won't solve your

Sure I did. Unfortunately they don't suggest any good way to handle your build process with it in their examples. Seems to me they never tried testing an application with it.

I plan to go down the QTestLib route. Maybe it could be combined with LDTP[1] for blackbox testing -- they claim to be able to use Qt 4's accessibility to control an application.

> buildsystem issues. You'll need one .pro per test. (I have one .pro
> per test plus one directory per test). There's probably other ways to
> using it.

Depends on what you call a test. But generally there should be no reason to have more than one .pro file for all tests. You just need to manually maintain a list of test classes or create some kind of static instance self-registration (which I did).

> http://doc.trolltech.com/4.4/qtestlib-manual.html#qtestlib
[1] http://ldtp.freedesktop.org/
-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: Benjamin SergeantNext: Marco Costalba
Message 3 of 17 in “[QGIT RFC] Unit tests for QGit”
  1. Jan HudecAug 8, 2008
  2. Benjamin SergeantAug 8, 2008
  3. Jan HudecAug 10, 2008
  4. Marco CostalbaAug 17, 2008
  5. Jan HudecAug 17, 2008
  6. Marco CostalbaAug 17, 2008
  7. Jan HudecAug 17, 2008
  8. Marco CostalbaAug 17, 2008
  9. Jan HudecAug 18, 2008
  10. Marco CostalbaAug 19, 2008
  11. Jan HudecAug 27, 2008
  12. Marco CostalbaAug 28, 2008
  13. Karl HasselströmAug 28, 2008
  14. Marco CostalbaAug 28, 2008
  15. Jan HudecAug 28, 2008
  16. Marco CostalbaAug 29, 2008
  17. Karl HasselströmAug 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.