libfprint/tests/run-umockdev.sh
Petr Šabata 4457edfdae RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/libfprint#929289033262b4d0be67cbff62029bfd2c923d2a
2020-10-15 16:00:16 +02:00

38 lines
829 B
Bash
Executable File

#!/usr/bin/bash
set -u
# Switch into the tests directory
cd source/tests || exit 1
# check if we need to install additional packages
# which is the case if we are on RHEL 8
source /etc/os-release || exit 1
if [[ "$ID" = *"rhel"* ]] && [[ "$VERSION_ID" == *"8"* ]]; then
dnf config-manager -y --add-repo umockdev.repo
dnf install -y umockdev-devel python3-gobject-base
pip3 install python-dbusmock
fi
# Each directory in source/tests is a umockdev based test
# discover them
declare -a TESTS=()
for f in *; do
test -d $f && TESTS+=( "$f" )
done
export FP_DEVICE_EMULATION=1
# execute all the tests, one by one
RESULT=0
for test in ${TESTS[@]}; do
echo "$test"
./umockdev-test.py "$test"
RES=$?
echo "$test finished with return code $RES"
echo ""
((RESULT += $RES))
done
exit $RESULT