From 02ddd12eb4308d043fc5541f313a1b95b920497e Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Fri, 28 Jun 2019 15:46:18 +0100 Subject: [PATCH] d/tests: Add a fallback for missing gnome-desktop-testing Signed-off-by: Simon McVittie <smcv@collabora.com> --- debian/tests/control | 4 ++++ debian/tests/run | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 debian/tests/run diff --git a/debian/tests/control b/debian/tests/control index 956fb86ec..56dee8816 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -2,6 +2,10 @@ Tests: build Restrictions: allow-stderr Depends: libsteam-runtime-tools-0-dev +Tests: run +Restrictions: allow-stderr +Depends: libsteam-runtime-tools-0-tests + Tests: gnome-desktop-testing Restrictions: allow-stderr Depends: gnome-desktop-testing, libsteam-runtime-tools-0-tests diff --git a/debian/tests/run b/debian/tests/run new file mode 100755 index 000000000..2b5b27134 --- /dev/null +++ b/debian/tests/run @@ -0,0 +1,40 @@ +#!/bin/sh + +# Copyright © 2019 Collabora Ltd. +# +# SPDX-License-Identifier: MIT +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# This is basically a small reimplementation of gnome-desktop-testing-runner, +# for older runtimes that don't have it. + +set -eu + +fail= + +for t in /usr/share/installed-tests/steam-runtime-tools-0/*.test; do + exec="$(sed -ne 's/^Exec=//p' "$t")" + $exec || fail=yes +done + +if [ -n "$fail" ]; then + exit 1 +fi -- GitLab