summaryrefslogtreecommitdiff
path: root/test/run-cairo-test-suite.sh
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-11 12:38:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-06-11 12:38:17 +0100
commitb49c944fe4abb9f3c70fac02a71061bf8d07259a (patch)
tree5bd3fd804edad88e82449c33e5bef0fa523e73b3 /test/run-cairo-test-suite.sh
parent4e4724d48c63d0cd4ec507ce72dcc55fb6e5f584 (diff)
test: Add a convenience script to disable the screensaver when testing
If the screensaver activates, it can cause failures when attempting to render into an xlib window, so inhibit if we know how.
Diffstat (limited to 'test/run-cairo-test-suite.sh')
-rwxr-xr-xtest/run-cairo-test-suite.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/run-cairo-test-suite.sh b/test/run-cairo-test-suite.sh
new file mode 100755
index 000000000..567d2b14b
--- /dev/null
+++ b/test/run-cairo-test-suite.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -m
+
+if `which gnome-screensaver-command`; then
+ gnome-screensaver-command -i -n "cairo-test-suite" -r "Cairo needs to read back from the screen in order to test rendering to xlib" &
+ pid=$!
+
+ restore_screensaver() { kill $pid; }
+else
+ restore_screensaver() { :; }
+fi
+
+trap cleanup SIGINT SIGTERM
+
+./cairo-test-suite "$*"
+
+restore_screensaver