12to11/tests/run_tests.sh
hujianwei ed9a704e69 Add tearing control protocol
* 12to11-test.xml (test_surface) <committed>: New event.
* 12to11.c (XLMain): Initialize tearing control.
* Imakefile (SRCS, OBJS): Add tearing_control.c/.o.
(tearing-control-v1): New scanner target.

* compositor.h (enum _PresentationHint): New enum.
(struct _State): Add fields for tearing control.
(enum _ClientDataType): Add tearing control type.
* surface.c (SavePendingState, InternalCommit1): Handle
presentation hints.
* test.c (Commit): Send new committed event.
* tests/Imakefile (OBJS16, SRCS16): Add
tearing_control_test.c/tearing_control_test.o.
(PROGRAMS): Add tearing_control_test.
(tearing-control-v1): New scanner target.

* tests/buffer_test.c (test_names): Fix typos.
* tests/run_tests.sh (standard_tests): Add tearing_control_test.
* tests/svnignore.txt: Add tearing_control_test.
* xdg_surface.c (UpdateFrameRefreshPrediction): Return whether
or not refresh prediction is on.
(MaybeRunLateFrame): Don't clear StateLateFrame until after
SubcompositorUpdate.
(WasFrameQueued): New function.
(NoteFrame): If a frame was queued and async presentation was
requested, present now.
2022-11-19 06:36:56 +00:00

79 lines
2.1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Tests for the Wayland compositor running on top of an X serer.
# Copyright (C) 2022 to various contributors.
# This file is part of 12to11.
# 12to11 is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
# 12to11 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
# You should have received a copy of the GNU General Public License
# along with 12to11. If not, see <https://www.gnu.org/licenses/>.
pushd "$(dirname $0)"
declare -a standard_tests=(
simple_test damage_test transform_test viewporter_test
subsurface_test scale_test seat_test dmabuf_test
xdg_activation_test single_pixel_buffer_test buffer_test
tearing_control_test
)
make -C . "${standard_tests[@]}"
export GLOBAL_SCALE=1
export OUTPUT_SCALE=1
exec 3< <(stdbuf -oL ../12to11 -printsocket)
read -u 3 WAYLAND_DISPLAY
export WAYLAND_DISPLAY
echo "Compositor started at ${WAYLAND_DISPLAY}"
for test_executable in "${standard_tests[@]}"
do
echo "Running test ${test_executable}"
if ./${test_executable}; then
echo "${test_executable} completed successfully"
else
echo "${test_executable} failed; see its output for more details"
fi
done
echo "Starting Xvfb at :27"
Xvfb :27 &
sleep 1
exec 4< <(DISPLAY=:27 stdbuf -oL ../12to11 -printsocket)
read -u 4 WAYLAND_DISPLAY
export WAYLAND_DISPLAY
declare -a vfb_tests=(
select_test
)
make -C . "${vfb_tests[@]}" select_helper select_helper_multiple
echo "Compositor for vfb tests started at ${WAYLAND_DISPLAY}"
for test_executable in "${vfb_tests[@]}"
do
echo "Running test ${test_executable}"
if ./${test_executable}; then
echo "${test_executable} completed successfully"
else
echo "${test_executable} failed; see its output for more details"
fi
done
popd
trap 'jobs -p | xargs kill' EXIT