summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-09-25 13:30:18 -0700
committerAdam Jackson <ajax@redhat.com>2016-09-28 12:44:30 -0400
commit7fe5b9c02cf90b81532cb6dee3ec75c90c72c27c (patch)
tree38ef0b682702b03cd09376c427e66086a3117051 /test
parent7ac130a0664b43b6ba5324548c8f7ab8230f7199 (diff)
test: Make the piglit-running script callable with an arbitrary server
v2: Check that SERVER_COMMAND is set. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'test')
-rw-r--r--test/.gitignore1
-rw-r--r--test/Makefile.am1
-rwxr-xr-xtest/scripts/run-piglit.sh80
-rwxr-xr-xtest/scripts/xvfb-piglit.sh73
4 files changed, 86 insertions, 69 deletions
diff --git a/test/.gitignore b/test/.gitignore
index c44fc827a..47f766c5f 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -11,6 +11,7 @@ xfree86
xkb
xtest
signal-logging
+piglit-results
simple-xinit
*.log
*.trs
diff --git a/test/Makefile.am b/test/Makefile.am
index 24bfc35bc..cf19beca9 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -163,6 +163,7 @@ endif
EXTRA_DIST = \
$(SCRIPT_TESTS) \
scripts/xinit-piglit-session.sh \
+ scripts/run-piglit.sh \
ddxstubs.c \
$(NULL)
diff --git a/test/scripts/run-piglit.sh b/test/scripts/run-piglit.sh
new file mode 100755
index 000000000..11e9c1eb9
--- /dev/null
+++ b/test/scripts/run-piglit.sh
@@ -0,0 +1,80 @@
+#!/bin/sh
+
+set -e
+
+if test "x$XTEST_DIR" = "x"; then
+ echo "XTEST_DIR must be set to the directory of the xtest repository."
+ # Exit as a "skip" so make check works even without piglit.
+ exit 77
+fi
+
+if test "x$PIGLIT_DIR" = "x"; then
+ echo "PIGLIT_DIR must be set to the directory of the piglit repository."
+ # Exit as a "skip" so make check works even without piglit.
+ exit 77
+fi
+
+if test "x$PIGLIT_RESULTS_DIR" = "x"; then
+ echo "PIGLIT_RESULTS_DIR must be set to where to output piglit results."
+ # Exit as a real failure because it should always be set.
+ exit 1
+fi
+
+if test "x$XSERVER_DIR" = "x"; then
+ echo "XSERVER_DIR must be set to the directory of the xserver repository."
+ # Exit as a real failure because it should always be set.
+ exit 1
+fi
+
+if test "x$XSERVER_BUILDDIR" = "x"; then
+ echo "XSERVER_BUILDDIR must be set to the build directory of the xserver repository."
+ # Exit as a real failure because it should always be set.
+ exit 1
+fi
+
+if test "x$SERVER_COMMAND" = "x"; then
+ echo "SERVER_COMMAND must be set to the server to be spawned."
+ # Exit as a real failure because it should always be set.
+ exit 1
+fi
+
+startx \
+ $XSERVER_DIR/test/scripts/xinit-piglit-session.sh \
+ -- \
+ $SERVER_COMMAND
+
+# Write out piglit-summaries.
+SHORT_SUMMARY=$PIGLIT_RESULTS_DIR/summary
+LONG_SUMMARY=$PIGLIT_RESULTS_DIR/long-summary
+$PIGLIT_DIR/piglit-summary.py -s $PIGLIT_RESULTS_DIR > $SHORT_SUMMARY
+$PIGLIT_DIR/piglit-summary.py $PIGLIT_RESULTS_DIR > $LONG_SUMMARY
+
+# Write the short summary to make check's log file.
+cat $SHORT_SUMMARY
+
+# Parse the piglit summary to decide on our exit status.
+status=0
+# "pass: 0" would mean no tests actually ran.
+if grep "pass:.*0" $SHORT_SUMMARY > /dev/null; then
+ status=1
+fi
+# Fails or crashes should be failures from make check's perspective.
+if ! grep "fail:.*0" $SHORT_SUMMARY > /dev/null; then
+ status=1
+fi
+if ! grep "crash:.*0" $SHORT_SUMMARY > /dev/null; then
+ status=1
+fi
+
+if test $status != 0; then
+ $PIGLIT_DIR/piglit-summary-html.py \
+ --overwrite \
+ $PIGLIT_RESULTS_DIR/html \
+ $PIGLIT_RESULTS_DIR
+
+ echo "Some piglit tests failed."
+ echo "The list of failing tests can be found in $LONG_SUMMARY."
+ echo "An html page of the failing tests can be found at $PIGLIT_RESULTS_DIR/html/problems.html"
+fi
+
+exit $status
diff --git a/test/scripts/xvfb-piglit.sh b/test/scripts/xvfb-piglit.sh
index b775239e3..799f28500 100755
--- a/test/scripts/xvfb-piglit.sh
+++ b/test/scripts/xvfb-piglit.sh
@@ -1,72 +1,7 @@
-#!/bin/sh
-
-set -e
-
-if test "x$XTEST_DIR" = "x"; then
- echo "XTEST_DIR must be set to the directory of the xtest repository."
- # Exit as a "skip" so make check works even without piglit.
- exit 77
-fi
-
-if test "x$PIGLIT_DIR" = "x"; then
- echo "PIGLIT_DIR must be set to the directory of the piglit repository."
- # Exit as a "skip" so make check works even without piglit.
- exit 77
-fi
-
-if test "x$XSERVER_DIR" = "x"; then
- echo "XSERVER_DIR must be set to the directory of the xserver repository."
- # Exit as a real failure because it should always be set.
- exit 1
-fi
-
-if test "x$XSERVER_BUILDDIR" = "x"; then
- echo "XSERVER_BUILDDIR must be set to the build directory of the xserver repository."
- # Exit as a real failure because it should always be set.
- exit 1
-fi
-
-export PIGLIT_RESULTS_DIR=$PIGLIT_DIR/results/xvfb
-
-startx \
- $XSERVER_DIR/test/scripts/xinit-piglit-session.sh \
- -- \
- $XSERVER_BUILDDIR/hw/vfb/Xvfb \
+export SERVER_COMMAND="$XSERVER_DIR/hw/vfb/Xvfb \
-noreset \
- -screen scrn 1280x1024x24
-
-# Write out piglit-summaries.
-SHORT_SUMMARY=$PIGLIT_RESULTS_DIR/summary
-LONG_SUMMARY=$PIGLIT_RESULTS_DIR/long-summary
-$PIGLIT_DIR/piglit-summary.py -s $PIGLIT_RESULTS_DIR > $SHORT_SUMMARY
-$PIGLIT_DIR/piglit-summary.py $PIGLIT_RESULTS_DIR > $LONG_SUMMARY
-
-# Write the short summary to make check's log file.
-cat $SHORT_SUMMARY
-
-# Parse the piglit summary to decide on our exit status.
-status=0
-# "pass: 0" would mean no tests actually ran.
-if grep "pass:.*0" $SHORT_SUMMARY > /dev/null; then
- status=1
-fi
-# Fails or crashes should be failures from make check's perspective.
-if ! grep "fail:.*0" $SHORT_SUMMARY > /dev/null; then
- status=1
-fi
-if ! grep "crash:.*0" $SHORT_SUMMARY > /dev/null; then
- status=1
-fi
-
-if test $status != 0; then
- $PIGLIT_DIR/piglit-summary-html.py \
- --overwrite \
- $PIGLIT_RESULTS_DIR/html \
- $PIGLIT_RESULTS_DIR
+ -screen scrn 1280x1024x24"
+export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xvfb
- echo "Some piglit tests failed."
- echo "The list of failing tests can be found in $LONG_SUMMARY."
- echo "An html page of the failing tests can be found at $PIGLIT_RESULTS_DIR/html/problems.html"
-fi
+exec $XSERVER_DIR/test/scripts/run-piglit.sh
-exit $status