[PATCH:libXt 1/2 v3] Add test framework similar to xserver and use it to test XtAsprintf
Gaetan Nadon
memsize at videotron.ca
Tue Mar 15 05:38:04 PDT 2011
On Mon, 2011-03-14 at 21:47 -0700, Alan Coopersmith wrote:
> I didn't think that was necessary since the macros reported error if
> you had
> unit tests enabled and glib was missing - did I miss something?
>
The util macros aren't a a copy of the server code. I extracted the
requirements and generalized.
The default for both enable unit test and glib is "auto". Glib can be
used without enable unit test
and unit test can be used without glib. One can have some test cases
that using glib and other that don't.
Because of that staging, libXt can run test cases on a linker that does
not support -wrap, while
the server cannot.
For the "test framework" to be a "framework", it must address the needs
of more than one app
and be forward looking to other possible uses in the future.
I have tried to capture this essence here:
XORG_ENABLE_UNIT_TESTS will turn on/off unit testing, regardless
of how it is implemented. The default (yes/no) can be specified by each
module. It can be used by itself if glib or -wrap support is not needed.
XORG_WITH_GLIB will probe the system for glib-2.0. A different version
can be specified in each module. It will consult XORG_ENABLE_UNIT_TESTS
but can be used by itself in contexts other then unit testing.
The default (yes/no) can be specified by each module.
XORG_LD_WRAP will probe the linker for -wrap support. It will consult
XORG_ENABLE_UNIT_TESTS but can be used by itself in contexts
other then unit testing.
--enable-unit- --with glib-2.0 glib-2.0 HAVE_GLIB
tests -glib probed found
-----------------------------------------------------------------------------
auto auto yes yes yes
auto auto yes no no
auto yes yes yes yes
auto yes yes no no Error
auto no no no no
yes auto yes yes yes
yes auto yes no no Error
yes yes yes yes yes
yes yes yes no no Error
yes no no no no
no auto no no no
no yes no no no Error
no no no no no
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110315/2439426c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110315/2439426c/attachment.pgp>
More information about the xorg-devel
mailing list