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

Re: [QGIT RFC] Unit tests for QGit

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Aug 17, 2008, 08:57 UTC
Message-ID
<e5bfff550808170157m45532428y3956e5d0d92e97d9@mail.gmail.com>
In-Reply-To
<20080808211318.GA4396@efreet.light.src>
On Fri, Aug 8, 2008 at 10:13 PM, Jan Hudec <bulb@ucw.cz> wrote:
> Hello Marco and others,
>
Hi Jan,
  sorry to reply so late but I just returned from holiday (no PC there
due to it was severely forbidden by my boss aka wife :-)
Show 5 quoted lines
> 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).
>

That's interesting. I have NO experience on test suites for GUI applications (command line applications like git I would think are easier to setup some tests suite for)

Show 15 quoted lines
> 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.
>
This is not a cons IMHO if it helps in separating tests from sources.
As I said I am no expert, but I would try to
- Let the test suite be easily stripped/not compiled for the
publishing (remember that we have to produce also that little
qgit_install.exe file used on *that* OS)
- Let the test be compiled only on demand (during developing I just
want to compile and run as few things as possible: C++ is already
quite bad in that regard and I don't want the situation get worst. BTW
I consider C++ slow compile times the biggest and probably only
drawback of C++ against C for big projects)
- Try to find some literature/reference before starting coding. As I
said I am no expert of GUI testing, so I would probably try to find
some Qt projects that use it and see/ask the developers how they
managed to do that and what are the problems. Then try to be stick to
known best practice (read someone that has DONE that in a REAL
project, not someone that has WRITTEN about that in a paper or a
vendor marketing/documentation)

Anyhow I'm really interested in this thing, and hope to see your work soon. Please feel free to drop me a line for any help you think I can give you.

Bye Marco

Previous: Jan HudecNext: Jan Hudec
Message 4 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.