libglvnd/tests/testglxmcthreads.sh
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

11 lines
320 B
Bash
Executable file

#!/bin/bash
export __GLX_VENDOR_LIBRARY_NAME=dummy
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TOP_BUILDDIR/tests/GLX_dummy/.libs
# We require pthreads be loaded before libGLX for correctness
export LD_PRELOAD=libpthread.so.0
# Run the make current test in a loop in multiple threads.
./testglxmakecurrent -t 5 -i 20000