[PATCH synaptics 15/17] Add basic framework for unit-testing.

Gaetan Nadon memsize at videotron.ca
Mon Mar 21 18:03:35 PDT 2011

On Tue, 2011-03-22 at 09:54 +1000, Peter Hutterer wrote:

> IIRC, the main reason we have disable-unit-tests is because we chose
> glib as
> testing suite and that wasn't available on all platforms. One thing we
> get
> in the server now is commits that fix build issues in the tests
> because few
> people build (or run) the tests.
> note that glib isn't used here, so there's little reason to disable
> the unit
> tests.
> I'd rather have the build enabled by default, if not the test run
> itself.

The building is enabled by default, I don't understand why you think it


I think there is some confusion. What prompted my comment is that I
noticed the fact that
if I configure the module:

        ./configure --disable-unit-tests

the unit test program will still build (but it will not run). I don't
know if it is right or wrong,
but it is not consistent with what others module did. Distro builders
may appreciate having
the ability to skip building all in-tree unit tests by issuing this
single configure option to all modules.

The default value for XORG_ENABLE_UNIT_TESTS is "auto", which in this
context is always "yes".
So the unit test will always build unless explicitly configured not to.
I was just surprised to
see in the makefile that the code ensures that the unit test program can
never ever be prevented
from building. 

        # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
        # Interface to module:
        # ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
        # enable_unit_tests:    used in configure.ac for additional configuration
        # --enable-unit-tests:	'yes' user instructs the module to build tests
        #			'no' user instructs the module not to build tests
        # parm1:		specify the default value, yes or no.

Note that the default (auto/yes/no) can be set in configure.ac:
XORG_ENABLE_UNIT_TEST(no)  It may be useful in some other modules.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110321/3d5861f1/attachment-0001.htm>
-------------- 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/20110321/3d5861f1/attachment-0001.pgp>

More information about the xorg-devel mailing list