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

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 21 18:51:29 PDT 2011

On Mon, Mar 21, 2011 at 09:03:35PM -0400, Gaetan Nadon wrote:
> 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
> isn't.

i think we're mixing terms here. in the server, building the tests only
happens on make check, not on a normal make. this is the situation i want to

having said that, I'm fine to move he build into the unittests condition,
but set to build when running make and only running the tests on make check.
I'll get the patch out for that in a minute.


> 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.

More information about the xorg-devel mailing list