diff options
author | Jeremy White <jwhite@codeweavers.com> | 2019-08-07 10:06:38 -0500 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2020-03-15 13:46:20 +0000 |
commit | 104637b3f52531ba927ab9bdbef1c964649b74e7 (patch) | |
tree | 8b8da44ed4e4ae8cbb40fd4ccdaa918081337b6c | |
parent | 45481c5281aa8a9960718960be6f6fec33973691 (diff) |
Add a very basic test for our OpenGL enabled driver.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r-- | src/tests/main.c | 4 | ||||
-rwxr-xr-x | src/tests/piglit1 | 31 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/tests/main.c b/src/tests/main.c index 65a193a..97b6b1c 100644 --- a/src/tests/main.c +++ b/src/tests/main.c @@ -37,6 +37,10 @@ int main(int argc, char *argv[]) g_test_add("/x11spice/x11perf1", xdummy_t, "x11perf1", start_server, test_script, stop_server); +#if defined(SPICEDUMMY) + g_test_add("/x11spice/piglit1", xdummy_t, "piglit1", start_server, test_script, stop_server); +#endif + g_log_set_always_fatal(G_LOG_LEVEL_ERROR); return g_test_run(); diff --git a/src/tests/piglit1 b/src/tests/piglit1 new file mode 100755 index 0000000..cf65558 --- /dev/null +++ b/src/tests/piglit1 @@ -0,0 +1,31 @@ +#!/bin/bash +# x11spice test script +# This will receive 4 arguments: +# $1 - Test X display, with a spice server attached +# $2 - Client X display, upon which we can run spicy +# $3 - Spice URI to connect to the spice server on $1 +# $4 - Directory we can use for logs and scratch info +# Note that it's also important that this script monitor itself; +# there is no external timeout mechanism + +which piglit 2>/dev/null +if [ $? -ne 0 ] ; then + echo piglit not available, skipping + exit 77 +fi + +echo Running piglit to see how we perform +spicy --display $2 --uri=$3 & +spid=$! +DISPLAY=:1 piglit run sanity $4/piglit +rc=$? + +ps -p $spid >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo Spice client not running. That is an error. + exit 1 +else + kill $spid +fi + +exit $rc |