Commit Graph

309 Commits

Author SHA1 Message Date
David Seifert 1610ef1d6b Fix building with `-fno-common`
* GCC 10 will switch the default to `-fno-common`.
  https://gcc.gnu.org/PR85678

Bug: https://bugs.gentoo.org/705880
Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-03-07 11:58:57 -08:00
Michel Dänzer 8db5a711da test: Use .../piglit instead of .../piglit-*.py
The latter use Python 2 and break with any non-ASCII characters in the
environment, the former uses Python 3 and works fine in that case.

Reviewed-by: Eric Anholt <eric@anholt.net>
(Cherry picked from commit 4aaaf69229)
2019-02-22 11:53:37 +01:00
Michel Dänzer 3314af2d15 gitlab-ci: Docker image can be generated as part of pipeline
This removes the dependency on an externally generated docker image, and
should make it easier to update the docker image or make other changes
related to it.

This is based on Debian testing, because I'm most familiar with Debian.
But it should be easy to base it on another distro.

v2:
* Use kaniko instead of docker-in-docker for image generation, so it can
  also work in unprivileged runners.
* Drop piglit.conf & tetexec.cfg overrides, just make sure the files in
  the image work.
(Cherry picked from commit f56d8e2282)
2019-02-22 11:53:12 +01:00
Michel Dänzer e8b4e94d51 Drop Travis Linux build in favour of GitLab CI
Fold build-travis-deps.sh into .gitlab-ci.yml.

Preparation for the next change, which would break the Travis Linux
build.

Reviewed-by: Eric Anholt <eric@anholt.net>
(Cherry picked from commit ed44f9cd6a)
2019-02-22 11:52:42 +01:00
Michel Daenzer b6ef90d83b travis: Use a single meson invocation
The prefix setting didn't take for some reason.
(Cherry picked from commit c1bb392b1d)
2019-02-22 11:51:35 +01:00
Peter Hutterer 356cf07b8a test: fix failing tests
Broken since 69d8ea4a49 because our fake screen
didn't have a root window and writing the XKB rules prop would happily
segfault. Fix this by setting up the required bits.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Michel Dänzer michel.daenzer@amd.com
(cherry picked from commit fde27b9b48)
2019-02-20 14:23:50 -05:00
Adam Jackson 243a34e170 travis: Bump rawhide image
The image now has enough mojo to run xts, hooray!

Note there's a couple of ugly bits in here. The piglit config fragment
and stock tetexec.cfg reflect missing features from the test suites
(using an installed copy of xts, figuring out the xserver test matrix at
runtime, etc.), I'll be happy to remove them once the tests are fixed.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-21 12:11:23 -04:00
Adam Jackson 8718d46157 ci: Ignore builds for branches aimed at other CI services
Make appveyor ignore builds for /travis.*/ and vice versa. If you're
only testing a Windows change, building for OSX and Linux too is a bit
rude.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-21 09:35:38 -04:00
Adam Jackson 8f628033be travis: Update OSX build
Install and use xorgproto, and build with optimization as clang has
warnings that only work above -O0. Also expand the build matrix for both
Xcode 8.3 and 9.2. Both images are OSX 10.12 at the moment so this is
really just a way to test with clang 8 vs 9.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-14 15:12:49 -04:00
Adam Jackson 1ca092f990 travis: Switch linux build from stretch to rawhide
Stretch's Mesa is too far behind, and building Mesa to build xserver is
not the sort of problem we're trying to solve here. But our Travis
scripts run inside a docker image, and that image can be whatever, so
since I have to keep rawhide building anyway let's switch to that for
now. The dockerfile can be found at:

https://github.com/nwnk/xserver-travis

The $DISTRO part of the change is foreshadowing for the day we readd a
(probably sid-based) debian image; patches for other environments are
welcome.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-14 15:08:34 -04:00
Adam Jackson 67c303fff3 miinitext: Load GLX on the mi path
Add a stub for Xnest so it continues to link, but otherwise we support
GLX on every server so there's no need to make every DDX add it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:48 -05:00
Adam Jackson 3db7707df3 test: Fix build dependency for bigreq test
libxcb-xinput isn't a thing in whichever Ubuntu it is that Travis is
using. The test is already optional, make it more so.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-12-08 11:36:24 -05:00
Eric Anholt 14af8bee24 test: Add a test for the overflow bug in bigreqs.
The failing struct comes from the python test written by Michal Srb
<msrb@suse.com>.

v2: Use a drawable (root window) and gc, so that PolyLines hopefully
    actually tries processing things.  However, the request seems to
    process successfully so the poll() just stalls out.  However, this
    does let us distinguish between detecting the bigrequests error
    and not, at least.
v3: Clean up the description of what we expect the poll() call to do.
v4: Use XI2 instead of PolyLine to trigger a predictable error. We know the
    server replies with BadValue for a zero num_masks argument. So if we send
    a bigreq with a num_masks 0 and a length 0, we can just check whether we
    get killed (good) or a BadValue (bad). It doesn't test for specific memory
    overflows or crashes, but based on the assumption that we shouldn't look
    at *any* BigReq of size 0, this seems to be sufficient.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-01 10:29:00 +10:00
Daniel Martin d5379b350f Use ARRAY_SIZE all over the tree
Roundhouse kick replacing the various (sizeof(foo)/sizeof(foo[0])) with
the ARRAY_SIZE macro from dix.h when possible. A semantic patch for
coccinelle has been used first. Additionally, a few macros have been
inlined as they had only one or two users.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-10-30 13:45:20 -04:00
Daniel Martin 15a32ee5d1 test: signal-logging: Fix looping signed number tests
unsigned_tests[] was used to compute the amount of signed numbers to
test.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-30 13:44:53 -04:00
Daniel Martin 0bcc65f2bf test: input: Fix used uninitialized warning in dix_event_to_core
input.c: In function ‘dix_event_to_core’:
../include/inputstr.h:61:55: warning: ‘*((void *)&ev+80)’ is used uninitialized in this function [-Wuninitialized]
 #define SetBit(ptr, bit)  (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
                                                       ^~

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-30 13:44:45 -04:00
Adam Jackson 041f25afa8 test: const correctness fix
../test/sync/sync.c: In function ‘main’:
../test/sync/sync.c:288:40: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     xcb_query_extension_reply_t *ext = xcb_get_extension_data(c, &xcb_sync_id);
                                        ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-04 11:19:09 -04:00
Adam Jackson 0888b22fea test: Fix a thinko in simple-xinit
Spotted by clang courtesy of the shiny new OSX Travis target:

simple-xinit.c:90:65: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [10]' [-Wsizeof-array-decay]
    ret = read(displayfd, display_string, sizeof(display_string - 1));

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-09-25 15:37:59 -04:00
Jon Turney 0b00440678 travis: Also build on OSX
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-09-23 22:47:36 -07:00
Eric Anholt 5cbfa27654 test: Add basic SYNC tests.
I couldn't find any, and I was modifying the implementation, so I had
to write some.  I would like the test to end with a "make sure there
weren't any stray unchecked errors", but I didn't figure out how to do
that.

v2: Extend sync tests to cover alarm delta and waitvalue changes.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-09-20 13:19:27 -04:00
Eric Anholt 3336291fc6 test: Return error from simple-xinit if the client crashes.
I want to be able to call client tests with simple-xinit, so assertion
failures should be an error.

v2: Clean up identical returns.

Signed-off-by: Eric Anholt <eric@anholt.net>
2017-09-20 13:19:27 -04:00
Eric Anholt a8eeb332cc meson: Add Xvfb and Xephyr-glamor testing.
The Xvfb tests are passing and Xephyr-glamor is failing for me, but it
fails identically on autotools.  It's disabled on Travis for now
because the >10 minutes of silence during testing times out the entire
build.

v2: Fix the disable on travis.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-20 13:19:25 -04:00
Peter Hutterer ea82ececbf test: fix compiler warning
signal-logging.c:182:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-06 11:53:02 +10:00
Eric Anholt f211015771 test: Remove unused ddxstubs.c
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-08-14 12:32:33 -07:00
Eric Anholt b62e486c4e travis: Set prefix to /usr, so we find xkbcomp.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-08-11 11:02:51 -04:00
Jon TURNEY fbdd73fac6 Move statically linked xorgxkb files from dixmods to a separate directory
[ajax: Fixed test/Makefile.am as well]

Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-06-27 12:42:06 -04:00
Eric Anholt 01dfb65ee2 travis: Add a build script for Travis CI.
This currently does a meson build using a docker image I've prepared.
The Dockerfile source is at:

    https://github.com/anholt/xserver-travis

Docker proved to be necessary to cut the build time per Travis push.
If some day we end up using meson in more of the X stack, we may be
able to move more dependencies out of the docker image and into the CI
build (putting the I in CI).  Until then, we'll have to do docker
image rebuilds when dependencies are added/updated.

To enable Travis CI on your github repository, see the first two steps
of the docs at:

    https://docs.travis-ci.com/user/getting-started/

Once you do that, pushing branches to your github repo will trigger
builds, which will send you email if they fail.  Current build status
can be veiewed your account on travis-ci.org:

    https://travis-ci.org/anholt/xserver
2017-06-13 10:36:25 -04:00
Eric Anholt fec9607c8e Remove support for unaligned swaps.
The previous misc.h code went out of its way to allow swapping of
unaligned pointers to values.  However, the members of an X
request/response are always naturally aligned within the struct, and
the buffers containing a request/response will also be aligned to at
least 8 bytes, so we can just drop it.

        text      data   bss    dec      hex    filename
before: 2215167	  51552	 132016	2398735	 249a0f	hw/xfree86/Xorg
after:  2214919	  51552	 132016	2398487	 249917	hw/xfree86/Xorg

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-25 15:01:23 -07:00
Eric Anholt 4552238960 Add unit tests for the byte swapping macros.
Peter noted a weirdness in my new bswap code, which could use some
tests to justify it.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-25 15:01:23 -07:00
Alan Coopersmith f81343dd2f Mark test_data static in Xinput protocol tests to avoid clashes
Fixes warning from Solaris linker:
ld: warning: symbol 'test_data' has differing sizes:
    (file tests-protocol-xigetselectedevents.o value=0x418;
     file tests-protocol-xigetclientpointer.o value=0x18);
    tests-protocol-xigetselectedevents.o definition taken

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-24 11:05:04 +10:00
Adam Jackson 646bc74cde test: Fix distcheck failures
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-03-14 12:28:24 -04:00
Jon Turney 669eb0a654 test: Use correct signature for XISetEventMask wrapper
This looks like it's always been wrong, but didn't matter before the single
test binary changes as the wrapper was only in place for tests which didn't
care about it's effects, so didn't forward to the real implementation. (see
the changes to protocol-xiselectevents.c in 773fc07e)

This fixes the protocol_xigetselectedevents_test for me.  I'm a bit
surprised that passes for anyone at the moment.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-09 14:07:58 +10:00
Mihail Konev fde5cd7848 tests: Fix guards for ld -wrap
Fixes XQuartz build.

Regressed-in: 23f6dbc96e
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-02-23 13:16:07 -05:00
Martin Peres b1a6986395 tests: shuffle around the linking order to please GNU ld
Classic GNU ld resolves symbol dependencies only forward, while GOLD
seems to work regardless of the specified library order.

Suggested-by: Eero Tamminen <eero.t.tamminen@intel.com>
Reviewed-by: Mihail Konev <k.mvc@ya.ru>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
2017-01-25 14:47:10 -05:00
Mihail Konev 6f531b0cdf tests: Fix typo
Remove redundrant/incorrect automake assignment.

Buglink: https://lists.x.org/archives/xorg-devel/2017-January/052320.html
Reported-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-01-16 15:42:42 -05:00
Giuseppe Bilotta 3f8c2f9448 tests: Fix without-dtrace build
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Mihail Konev <k.mvc@ya.ru>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-16 15:01:33 -05:00
Adam Jackson b44bef513b Revert "tests: fix --disable-xorg build"
Pushed the wrong thing.

This reverts commit 730fd8c05f.
2017-01-16 14:59:40 -05:00
Mihail Konev 730fd8c05f tests: fix --disable-xorg build 2017-01-16 14:40:37 -05:00
Mihail Konev 704a867f8f tests: Remove obsolete libxservertest.la
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-12 15:01:41 -05:00
Mihail Konev 23f6dbc96e tests: Move test/{xi1,xi2}/tests to test/
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-12 15:01:38 -05:00
Mihail Konev ead5064581 tests: Convert test/ to single binary
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-12 15:01:36 -05:00
Mihail Konev 773fc07e4c tests: Convert test/xi2/ to single binary
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-12 15:01:33 -05:00
Mihail Konev 371576f64b tests: Convert test/xi1/ to single binary
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-12 15:01:29 -05:00
Mihail Konev ff66bca3e8 tests: Refactor wraps into protocol-common.c
Part of refactoring the tests into a single binary,
to make partial rebuild slightly faster and less verbose.

Prepares for joining test/xi2/protocol-* into a single binary.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-12 15:01:19 -05:00
Mihail Konev 45546219e1 tests: Avoid libtool message
The "copying selected object files" message appears as some source
files have the same name, and some objects are included twice.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-12 13:25:52 -05:00
Pekka Paalanen b365c5d168 test: fix distributing scripts
Fix the following error on 'make distcheck':

make[6]: *** No rule to make target 'scripts/xvfb-piglit.sh', needed by 'scripts/xvfb-piglit.sh.log'.  Stop.
make[6]: Leaving directory '/home/pq/git/xserver/xorg-server-1.19.99.1/_build/sub/test'
Makefile:1367: recipe for target 'check-TESTS' failed

The setup to trigger this is:
  $ ./configure --prefix=/home/pq/local --disable-docs
  --disable-devel-docs --enable-xwayland --disable-xorg --disable-xvfb
  --disable-xnest --disable-xquartz --disable-xwin --enable-debug

SCRIPT_TESTS is populated conditionally, but we should distribute the
scripts in any case.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-12-07 12:47:04 -05:00
Rhys Kidd cf8860786c test: Fix stray Makefile reference to removed os test
Fixes the following warning:

test/Makefile.am:69: warning: variable 'os_LDADD' is defined but no program or
test/Makefile.am:69: library has 'os' as canonical name (possible typo)

Introduced upon the removal of test/os in:

commit 6a5a4e6037
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Dec 8 14:39:46 2015 -0800

    Remove SIGIO support for input [v5]

    This removes all of the SIGIO handling support used for input
    throughout the X server, preparing the way for using threads for input
    handling instead.

    Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls
    to stub functions input_lock/input_unlock so that we don't lose this
    information.

    xfree86 SIGIO support is reworked to use internal versions of
    OsBlockSIGIO and OsReleaseSIGIO.

    v2: Don't change locking order (Peter Hutterer)
    v3: Comment weird && FALSE in xf86Helper.c
        Leave errno save/restore in xf86ReadInput
        Squash with stub adding patch (Peter Hutterer)
    v4: Leave UseSIGIO config parameter so that
        existing config files don't break (Peter Hutterer)
    v5: Split a couple of independent patch bits out
        of kinput.c (Peter Hutterer)

    Signed-off-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-19 16:27:35 +10:00
Michel Dänzer 95d3980c7c test: Use $XSERVER_BUILDDIR for Xvfb executable path
Fixes make check with out-of-tree builds.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-10-05 15:25:28 -04:00
Adam Jackson 7a5ddf8da5 test: Re-enable a couple of GetImage tests
Fixed in 6c6f09aac.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-09-28 15:48:24 -04:00
Eric Anholt c49e820f79 test: Run xts against Xephyr -glamor when present
v2: Drop x8r8g8b8 skip, now that it's fixed.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2016-09-28 12:44:51 -04:00