Commit graph

6 commits

Author SHA1 Message Date
Brian Nguyen f3c6f65d36 [tests] Add testglxgetclientstr subtest
This subtest verifies that the GLX API library's implementation of
glXGetClientString() (which takes the "union" (concatenation) of each
vendor's client string) works as expected.
2013-08-26 11:03:43 -07:00
Brian Nguyen 67f04602e6 [tests] Add testglxmcoldlink subtest
This is a variant of the testglxmakecurrent subtest which links against
the libGL filter library instead of libOpenGL + libGLX. This verifies
the ELF symbol filtering works as expected.
2013-08-26 11:03:43 -07:00
Brian Nguyen 808706d3a2 [tests] Add make current subtests
This implements a test app, testglxmakecurrent, which verifies the
correctness of the API library's GL dispatching when a vendor's context
is current in one or more threads.

This test spawns a given number of threads each with their own separate
context and window, and has each thread make current to its given
context. The thread then calls some core GL functions and
(to-be-implemented) a GL extension function, glMakeCurrentTestResults(),
which returns the number of times each core GL function was called.
The test then compares glMakeCurrentTestResults()'s result (which should
match up with the vendor library's call count) to the application's call
count and fails if there is a mismatch.

The test is designed to only require pthreads if multiple threads are
used. This verifies that the API library's single-threaded fake pthread
wrapper functions work properly.

Add testglxmc{basic,late,loop,threads}.sh scripts, which run the
testglxmakecurrent test with different arguments for ordering of
glXGetProcAddress(), number of threads, and number of iterations.

Isolate helper functions for window creation/destruction to a separate
test_utils.c source file which will be used by later tests.
2013-08-26 11:03:43 -07:00
Brian Nguyen e0e68e14d4 [tests] Add testglxgetprocaddress subtest
This subtest verifies that glXGetProcAddress() works for the various
classifications of "GetProcAddress-able" functions:

- GLX 1.4 functions with dispatchers implemented directly by the API
  library
- GLX 1.4 extension functions with dispatchers implemented by a vendor
  loaded by the API library
- Core OpenGL functions with static dispatch stubs in libGLdispatch
- Core OpenGL functions with dynamic dispatch stubs generated by
  libGLdispatch

This also tests some assertions about these dispatch stubs; namely that
the core GL dispatch stubs are no-ops if no context is current.
2013-08-26 11:03:43 -07:00
Brian Nguyen b3f7cbc3e0 [tests] Add a GLX_dummy dummy vendor library
This vendor library will be loaded by the API library in various
subtests in the test suite, and will implement the bare minimum
needed to verify features and code paths in the API library. This
includes creating a fake GL "context", making current to the
"context", and calling some GL functions.
2013-08-26 11:03:43 -07:00
Brian Nguyen 42589ec4c5 [tests] Add basic test infrastructure
This adds build infrastructure for unit testing the API library
using the serial test harness. TODO: this should be replaced with
the parallel test harness, as the automake documentation says the
serial harness is deprecated.

The first and last tests to be run are scripts to initialize the test
environment (an X session with a special -modulepath argument and
xorg.conf file to pick up x11glvnd) and tear it down after all unit
tests are run.

This also adds a placeholder directory for a fake vendor library
called "GLX_dummy", to be implemented later.
2013-08-26 11:03:43 -07:00