sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-28 05:57:34 +00:00
commit 88965415ff
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26235 changed files with 29195616 additions and 0 deletions

View file

@ -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
$XSERVER_BUILDDIR/test/simple-xinit \
$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 console -s $PIGLIT_RESULTS_DIR > $SHORT_SUMMARY
$PIGLIT_DIR/piglit summary console $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
$PIGLIT_DIR/piglit summary html \
--overwrite \
$PIGLIT_RESULTS_DIR/html \
$PIGLIT_RESULTS_DIR
if test $status != 0; then
echo "Some piglit tests failed."
echo "The list of failing tests can be found in $LONG_SUMMARY."
fi
echo "An html page of the test status can be found at $PIGLIT_RESULTS_DIR/html/index.html"
exit $status

View file

@ -0,0 +1,32 @@
#!/bin/sh
# this times out on Travis, because the tests take too long.
if test "x$TRAVIS_BUILD_DIR" != "x"; then
exit 77
fi
# Start a Xephyr server using glamor. Since the test environment is
# headless, we start an Xvfb first to host the Xephyr.
export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xephyr-glamor
export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/kdrive/ephyr/Xephyr \
-glamor \
-glamor-skip-present \
-noreset \
-schedMax 2000 \
-screen 1280x1024"
# Tests that currently fail on llvmpipe on CI
PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea@6"
PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea@7"
PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow@4"
PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow@5"
PIGLIT_ARGS="$PIGLIT_ARGS -x xcopyarea@1"
export PIGLIT_ARGS
$XSERVER_BUILDDIR/test/simple-xinit \
$XSERVER_DIR/test/scripts/run-piglit.sh \
-- \
$XSERVER_BUILDDIR/hw/vfb/Xvfb \
-screen scrn 1280x1024x24

View file

@ -0,0 +1,37 @@
#!/bin/sh
# .xinitrc replacement to run piglit and exit.
#
# Note that piglit will run many processes against the server, so
# running the server with -noreset is recommended to improve runtime.
set -e
if test "x$PIGLIT_DIR" = "x"; then
echo "PIGLIT_DIR must be set to the directory of the piglit repository."
exit 1
fi
if test "x$PIGLIT_RESULTS_DIR" = "x"; then
echo "PIGLIT_RESULTS_DIR must be defined"
exit 1
fi
if test "x$XTEST_DIR" = "x"; then
echo "XTEST_DIR must be set to the root of the built xtest tree."
exit 1
fi
cd $PIGLIT_DIR
# Skip some tests that are failing at the time of importing the script.
# "REPORT: min_bounds, rbearing was 0, expecting 2"
PIGLIT_ARGS="$PIGLIT_ARGS -x xlistfontswithinfo@3"
PIGLIT_ARGS="$PIGLIT_ARGS -x xlistfontswithinfo@4"
PIGLIT_ARGS="$PIGLIT_ARGS -x xloadqueryfont@1"
PIGLIT_ARGS="$PIGLIT_ARGS -x xqueryfont@1"
PIGLIT_ARGS="$PIGLIT_ARGS -x xqueryfont@2"
# Run as meson unit tests.
PIGLIT_ARGS="$PIGLIT_ARGS -x rendercheck"
exec ./piglit run xts-render $PIGLIT_ARGS $PIGLIT_RESULTS_DIR

View file

@ -0,0 +1,14 @@
#!/bin/sh
# this times out on Travis, because the tests take too long.
#if test "x$TRAVIS_BUILD_DIR" != "x"; then
# exit 77
#fi
export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/vfb/Xvfb \
-noreset \
-screen scrn 1280x1024x24"
export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xvfb
exec $XSERVER_DIR/test/scripts/run-piglit.sh