Re: running without a mainlopp for unittests
- From: Stefan Kost <kost imn htwk-leipzig de>
- To: Tristan Van Berkom <tristan van berkom gmail com>
- Cc: GTK Mailing List <gtk-app-devel-list gnome org>
- Subject: Re: running without a mainlopp for unittests
- Date: Thu, 03 Feb 2005 20:41:39 +0100
Hi,
I use check too ;).
Are your tests available somehwere ?
Stefan
Tristan Van Berkom wrote:
On Thu, 03 Feb 2005 19:07:48 +0100, Stefan Kost
<kost imn htwk-leipzig de> wrote:
hi hi,
I currently fight with some highlevel unit test, that should basically start the
application and immeditely exit.
The Problem I have is that instead of calling gtk_main() I want to init
everything and then shut-down.
The test-framework stats tests with fork to capture crashing.
Before I initialize g_thread and gdk_threads. I wrap lauching the test suite in
gdk_thread_enter/leave().
When the tests run, I often get XLib errors a la
sequence lost (0x100b9 > 0xb9) in reply to 0x0!
...
To me this sounds like probelm in message passing. Should I add another
gdk_thread_enter/leave() after the fork (for each test case)?
Does anyone do unit test that test the GUI?
I use "check" to unit test things that run in a GMainLoop, I dont use it
for the GUI mostly because the vast majority of tests I have to run on
GUI elements are functional tests.
In "check" there is a mechanism that allows you to setup "init" and
"teardown" stubs (that are also unit test functions) that will be run
after the fork() and before the exit() for every "unit test" in a given
"test suite", I would think that gtk_init() would belong in one of these
"init" stubs
If your test application is "forked" (like check does) it shouln't cause any
conflicts at the xlib client-server level (contrary to if it was threaded), so
I'm quite sure you dont need to hold the gdk_threads_mutex during unit
tests.
Just my 2 cents ;-)
Cheers,
-Tristan
--
\|/ Stefan Kost
<@ @> private business
+-oOO-(_)-OOo------------------------------------------------------ - - - - -
| __ Address Simildenstr. 5 HTWK Leipzig, Fb IMN, Postfach 301166
| /// 04277 Leipzig 04251 Leipzig
| __ /// Germany Germany
| \\\/// Phone +49341 2253538 +49341 30766101
| \__/ EMail st_kost_at_gmx.net kost_at_imn.htwk-leipzig.de
| WWW www.sonicpulse.de www.imn.htwk-leipzig.de/~kost/about.html
===-=-=--=---=---------------------------------- - - - - -
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]