2018-03-08 19:43:49 +01:00
|
|
|
#!/bin/sh
|
[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-12 22:12:10 +02:00
|
|
|
|
2018-03-08 19:43:49 +01:00
|
|
|
. $TOP_SRCDIR/tests/glxenv.sh
|
[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-12 22:12:10 +02:00
|
|
|
|
|
|
|
# We require pthreads be loaded before libGLX for correctness
|
2018-03-08 19:43:49 +01:00
|
|
|
LD_PRELOAD=libpthread.so.0
|
|
|
|
export LD_PRELOAD
|
[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-12 22:12:10 +02:00
|
|
|
|
|
|
|
# Run the make current test in a loop in multiple threads.
|
|
|
|
./testglxmakecurrent -t 5 -i 20000
|