[PATCH xorg-gtest v2 0/9] Switch from a precompiled library to a source distribution

Chase Douglas chase.douglas at canonical.com
Wed Mar 14 11:27:50 PDT 2012


On 03/14/2012 05:57 AM, Gaetan Nadon wrote:
> On 12-03-14 02:35 AM, Chase Douglas wrote:
>> On 03/13/2012 10:39 PM, Chase Douglas wrote:
>>> On 03/13/2012 07:30 PM, Gaetan Nadon wrote:
>>>> On 12-03-13 08:53 PM, Gaetan Nadon wrote:
>>>>> On 12-03-13 02:47 PM, Chase Douglas wrote:
>>>>>> The major change in this round is to patch 8. Instead of instructing users to
>>>>>> include an automake snippet installed on the system, the README now says to copy
>>>>>> the snippet into the project. The snippet needs to be available before
>>>>>> autoreconf is run. It would be possible to copy the snippet into place in
>>>>>> autogen.sh, but that would be a very non-standard solution to the problem and
>>>>>> would require the user to have xorg-gtest installed.
>>>>>>
>>>>>> The xorg-gtest.m4 macro now sets BASE_CXXFLAGS and STRICT_CXXFLAGS properly.
>>>>>>
>>>>>> The other change is the addition of patch 9. It allows for the Xorg binary to be
>>>>>> set through a compilation flag. This should make it possible to use xorg-gtest's
>>>>>> main() with an Xorg server built in the xserver project.
>>>>>>
>>>>>> All XORG_MACROS_VERSION calls have been updated to require 1.17 for
>>>>>> XORG_ENABLE_INTEGRATION_TESTS.
>>>>>>
>>>>>> -- Chase
>>>>>>
>>>>> Some quick testing:
>>>>>
>>>>> Applying: Ship xorg-gtest.m4 and Makefile-xorg-gtest.am
>>>>> /home/nadon/xorg/src/test/xorg-gtest/.git/rebase-apply/patch:45:
>>>>> trailing whitespace.
>>>>> Moreover, a custom main() function that takes care of setting up the
>>>>> /home/nadon/xorg/src/test/xorg-gtest/.git/rebase-apply/patch:47:
>>>>> trailing whitespace.
>>>>> replacement for libgtest_main.a
>>>>> warning: 2 lines add whitespace errors.
>>>>>
>>>>> -----------------------------------------------------------------------------
>>>>>
>>>>> $ make distcheck:
>>>>> make[3]: Entering directory
>>>>> `/home/nadon/xorg/src/test/xorg-gtest/xorg-gtest-0.1.1/_build/examples'
>>>>>   CXX    libgtest_a-gtest-all.o
>>>>>   CXX    libxorg_gtest_a-xorg-gtest-all.o
>>>>>   CXX    libxorg_gtest_main_a-xorg-gtest_main.o
>>>>>   CXX    xorg-gtest-example.o
>>>>> In file included from ../../src/device.cpp:28:0,
>>>>>                  from ../../src/xorg-gtest-all.cpp:28:
>>>>> ../../include/xorg/gtest/evemu/device.h:36:19: fatal error: evemu.h: No
>>>> Something needs to be conditionally included when evemu package is not
>>>> available.
>>>>> such file or directory
>>>>> compilation terminated.
>>>>> make[3]: *** [libxorg_gtest_a-xorg-gtest-all.o] Error 1
>>> I hadn't tried make distcheck while libutouch-evemu was not installed.
>>> This was a simple fix: inside xorg-gtest-all.cpp, wrap #include
>>> "device.cpp" in a #ifdef HAVE_EVEMU.
>>>
>>> Now it builds and checks without issue with or without utouch-evemu
>>> installed.
>>>
>>>>> -----------------------------------------------------------------------------
>>>>>
>>>>>     *** Update comment as well with 1.17  *** We've all done this :-)
>>>>> # Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG
>>>>> m4_ifndef([XORG_MACROS_VERSION],
>>>>>       [m4_fatal([must install xorg-macros 1.16 or later before running
>>>>> autoconf/autogen])])
>>>>> XORG_MACROS_VERSION(1.17)
>>>>>
>>>>> -----------------------------------------------------------------------------
>>>>> Running "make all" or "make clean" does not produce anything, no targets
>>>>> to build or clean. This is strange as distcheck does find something to
>>>>> compile. Sorry, I did not have time to investigate, maybe it is just a
>>>>> local problem.
>>>> Ok, 'make check' is the target to invoke. Running 'distcheck' always
>>>> runs 'check'.
>>> Correct. We don't ship a library anymore, so there's no reason to build
>>> anything during normal make. Make check can be run to ensure that it
>>> builds and runs against the installed X server. If you disable
>>> integration tests, it will not attempt to run the example test.
>>>
>>>>> I have libgtest-dev installed but not libutouch-evemu-dev.
>>>>>
>>>>>
>>>> I installed evemu lib and the compilation is ok. However the TESTS
>>>> fails, so distcheck fails.
>>>>
>>>>     make  check-TESTS
>>>>     make[3]: Entering directory
>>>>     `/home/nadon/xorg/src/test/xorg-gtest/xorg-gtest-0.1.1/_build/examples'
>>>>     [==========] Running 1 test from 1 test case.
>>>>     [----------] Global test environment set-up.
>>>>     unknown file: Failure
>>>>     C++ exception with description "Dummy X server failed to start, did
>>>>     you run as root?" thrown in auxiliary test code (environments or
>>>>     event listeners).
>>>>     FAIL: xorg-gtest-example
>>>>     ==================
>>>>     1 of 1 test failed
>>>>     ==================
>>>>     make[3]: *** [check-TESTS] Error 1
>>>>
>>>> If the intention was to run "integration" tests which requires root or
>>>> other special requirements, rather than a module unit testing, this will
>>>> conflict with the purpose of distcheck.
>>> The exception comment is a little old. With X server 1.12 you don't need
>>> to be root to run xorg-gtest tests.
>>>
>>> I'm not sure why it failed for you. Can you check /tmp/Xorg.GTest.log?
>>> Do you have the xserver installed?
>>>
>>> As for integration tests in xorg-gtest's distcheck, I'm not sure what is
>>> best, but I am leaning towards checking with the integration test as it
>>> exists today. It only requires that the xserver is available. I think
>>> that's a reasonable requirement for someone releasing xorg-gtest. They
>>> should be sure that it does work with the xserver.
>>>
>>> I have updated my "source" branch at
>>> git://people.freedesktop.org/~cndougla/xorg-gtest with the fix for the
>>> no-evemu build failure and the whitespace fixes. Once we resolve your
>>> test run failure I can send out a revision of the patches that hopefully
>>> resolves everything.
>> I just pushed a new commit to my "source" branch to print out a more
>> helpful error message when the server fails to start.
>>
>> Thanks!
>>
>> -- Chase
>>
> 
> The 'make check' is picking up my locally built X binary which I never
> use and is in an unknown state. The log in /tmp shows it fails as it
> cannot find a driver. This is expected in my situation.
> 
> I tried the "source" branch of
> git://people.freedesktop.org/~cndougla/xorg-gtest
> <git://people.freedesktop.org/%7Ecndougla/xorg-gtest> without any
> patches, but I get a compile error:
> xorg-gtest-example.cpp:1:29: fatal error: xorg/gtest/test.h: No such
> file or directory

Yes, the build is broken unless you already have xorg/gtest/test.h
installed. I fixed this in my source branch. Sorry for all the run
around, there's lots of permutations of installed libraries to test this
with.

I also added checks in configure.ac for whether running the example test
will work. By default, integration tests are enabled (yes), and if you
don't have an xorg server and dummy video driver installed it will fail
to configure. You can override this with --disable-integration-tests or
--enable-integration-tests=auto.

Thanks!

-- Chase


More information about the xorg-devel mailing list