2020-01-29 09:35:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-11-19 13:22:27 +00:00
|
|
|
set -x
|
2020-01-29 13:36:23 +00:00
|
|
|
set +e
|
2020-01-29 09:35:10 +00:00
|
|
|
|
2020-01-29 13:36:23 +00:00
|
|
|
srcdir=$( pwd )
|
2020-01-29 09:35:10 +00:00
|
|
|
builddir=$1
|
2023-11-19 13:22:27 +00:00
|
|
|
setup=$2
|
|
|
|
suite=$3
|
2023-05-02 10:36:18 +00:00
|
|
|
multiplier=${MESON_TEST_TIMEOUT_MULTIPLIER:-1}
|
2020-01-29 09:35:10 +00:00
|
|
|
|
2020-07-09 02:19:32 +00:00
|
|
|
# Ignore memory leaks lower in dependencies
|
2023-06-06 01:09:51 +00:00
|
|
|
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0:detect_leaks=0:allocator_may_return_null=1
|
2021-01-22 05:13:13 +00:00
|
|
|
export G_SLICE=always-malloc
|
2020-07-09 02:19:32 +00:00
|
|
|
|
2023-11-19 13:22:27 +00:00
|
|
|
case "${setup}" in
|
|
|
|
x11*)
|
2020-08-04 15:59:32 +00:00
|
|
|
xvfb-run -a -s "-screen 0 1024x768x24 -noreset" \
|
2020-05-15 13:44:24 +00:00
|
|
|
meson test -C ${builddir} \
|
2023-05-03 19:32:50 +00:00
|
|
|
--quiet \
|
2023-05-02 10:36:18 +00:00
|
|
|
--timeout-multiplier "${multiplier}" \
|
2020-01-29 13:36:23 +00:00
|
|
|
--print-errorlogs \
|
2023-11-19 13:22:27 +00:00
|
|
|
--setup=${setup} \
|
|
|
|
--suite=${suite//,/ --suite=} \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--no-suite=failing \
|
2023-11-19 13:22:27 +00:00
|
|
|
--no-suite=${setup}_failing \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--no-suite=flaky \
|
2023-09-21 16:17:47 +00:00
|
|
|
--no-suite=headless \
|
2020-05-16 14:12:47 +00:00
|
|
|
--no-suite=gsk-compare-broadway
|
2020-01-29 13:36:23 +00:00
|
|
|
|
2020-05-15 13:44:24 +00:00
|
|
|
# Store the exit code for the CI run, but always
|
|
|
|
# generate the reports
|
|
|
|
exit_code=$?
|
|
|
|
;;
|
|
|
|
|
2023-03-19 14:16:19 +00:00
|
|
|
wayland*)
|
2020-05-15 13:44:24 +00:00
|
|
|
export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
|
|
|
|
|
2020-05-28 13:15:04 +00:00
|
|
|
weston --backend=headless-backend.so --socket=wayland-5 --idle-time=0 &
|
2020-05-15 13:44:24 +00:00
|
|
|
compositor=$!
|
|
|
|
export WAYLAND_DISPLAY=wayland-5
|
|
|
|
|
2021-10-08 16:38:51 +00:00
|
|
|
meson test -C ${builddir} \
|
2023-05-03 19:32:50 +00:00
|
|
|
--quiet \
|
2023-05-02 10:36:18 +00:00
|
|
|
--timeout-multiplier "${multiplier}" \
|
2021-10-08 16:38:51 +00:00
|
|
|
--print-errorlogs \
|
2023-11-19 13:22:27 +00:00
|
|
|
--setup=${setup} \
|
|
|
|
--suite=${suite//,/ --suite=} \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--no-suite=failing \
|
2023-11-19 13:22:27 +00:00
|
|
|
--no-suite=${setup}_failing \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--no-suite=flaky \
|
2023-09-21 16:17:47 +00:00
|
|
|
--no-suite=headless \
|
2021-10-08 16:38:51 +00:00
|
|
|
--no-suite=gsk-compare-broadway
|
|
|
|
exit_code=$?
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
|
2021-10-08 16:38:51 +00:00
|
|
|
kill ${compositor}
|
|
|
|
;;
|
|
|
|
|
2023-11-19 13:22:27 +00:00
|
|
|
broadway*)
|
2020-05-15 13:44:24 +00:00
|
|
|
export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
|
|
|
|
|
|
|
|
${builddir}/gdk/broadway/gtk4-broadwayd :5 &
|
|
|
|
server=$!
|
|
|
|
export BROADWAY_DISPLAY=:5
|
|
|
|
|
|
|
|
meson test -C ${builddir} \
|
2023-05-03 19:32:50 +00:00
|
|
|
--quiet \
|
2023-05-02 10:36:18 +00:00
|
|
|
--timeout-multiplier "${multiplier}" \
|
2020-05-15 13:44:24 +00:00
|
|
|
--print-errorlogs \
|
2023-11-19 13:22:27 +00:00
|
|
|
--setup=${setup} \
|
|
|
|
--suite=${suite//,/ --suite=} \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--no-suite=failing \
|
2023-11-19 13:22:27 +00:00
|
|
|
--no-suite=${setup}_failing \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--no-suite=flaky \
|
2023-09-21 16:17:47 +00:00
|
|
|
--no-suite=headless \
|
2020-05-16 14:12:47 +00:00
|
|
|
--no-suite=gsk-compare-opengl
|
2020-05-15 13:44:24 +00:00
|
|
|
|
|
|
|
kill ${server}
|
|
|
|
;;
|
2021-10-08 16:38:51 +00:00
|
|
|
|
|
|
|
*)
|
2023-11-19 13:22:27 +00:00
|
|
|
echo "Failed to add ${setup} to .gitlab-ci/run-tests.sh"
|
2021-10-08 16:38:51 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
2020-05-15 13:44:24 +00:00
|
|
|
esac
|
2020-01-29 13:36:23 +00:00
|
|
|
|
2020-02-12 18:03:48 +00:00
|
|
|
cd ${builddir}
|
|
|
|
|
2023-05-03 19:10:17 +00:00
|
|
|
$srcdir/.gitlab-ci/meson-junit-report.py \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--project-name=gtk \
|
2023-11-19 13:22:27 +00:00
|
|
|
--backend="${setup}" \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--job-id="${CI_JOB_NAME}" \
|
2023-11-19 13:22:27 +00:00
|
|
|
--output="report-${setup}.xml" \
|
|
|
|
"meson-logs/testlog-${setup}.json"
|
2023-05-03 19:10:17 +00:00
|
|
|
|
|
|
|
$srcdir/.gitlab-ci/meson-html-report.py \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--project-name=gtk \
|
2023-11-19 13:22:27 +00:00
|
|
|
--backend="${setup}" \
|
testsuite: Use separate setups for unstable tests instead of should_fail
There are two possible interpretations of "expected failure": either
the test *must* fail (exactly the inverse of an ordinary test, with
success becoming failure and failure becoming success), or the test
*may* fail (with success intended, but failure possible in some
environments). Autotools had the second interpretation, which seems
more useful in practice, but Meson has the first.
Instead of using should_fail, we can put the tests in one of two new
suites: "flaky" is intended for tests that succeed or fail unpredictably
according to the test environment or chance, while "failing" is for
tests that ought to succeed but currently never do as a result of a
bug or missing functionality. With a sufficiently new version of Meson,
the flaky and failing tests are not run by default, but can be requested
by running a setup that does not exclude them, with a command like:
meson test --setup=x11_unstable --suite=flaky --suite=failing
As a bonus, now that we're setting up setups and their excluded suites
programmatically, the gsk-compare-broadway tests are also excluded by
default when running the test setup for a non-broadway backend.
When running the tests in CI, --suite=gtk overrides the default
exclude_suites, so we have to specify --no-suite=flaky and
--no-suite=failing explicitly.
This arrangement is inspired by GNOME/glib!2987, which was contributed
by Marco Trevisan.
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-11-23 19:13:32 +00:00
|
|
|
--job-id="${CI_JOB_NAME}" \
|
2023-11-19 13:22:27 +00:00
|
|
|
--reftest-output-dir="testsuite/reftests/output/${setup}" \
|
|
|
|
--output="report-${setup}.html" \
|
|
|
|
"meson-logs/testlog-${setup}.json"
|
2020-01-29 13:36:23 +00:00
|
|
|
|
|
|
|
exit $exit_code
|