Blame tests/canary_tests.sh.in

Packit Service af52df
#!/bin/sh -e
Packit Service af52df
# Run the translation canary tests on the translatable strings
Packit Service af52df
Packit Service af52df
if [ @WITH_PYTHON3@ != 1 ]; then
Packit Service af52df
    echo "Cannot run translations tests without python3, skipping."
Packit Service af52df
    exit 0
Packit Service af52df
fi
Packit Service af52df
Packit Service af52df
DISTRO=`busctl get-property org.freedesktop.hostname1 /org/freedesktop/hostname1 org.freedesktop.hostname1 OperatingSystemCPEName | cut -d ":" -f 3`
Packit Service af52df
if [ $DISTRO == "centos" -o $DISTRO == "enterprise_linux" ]; then
Packit Service af52df
    echo "Cannot run translations tests on CentOS/RHEL 7, skipping."
Packit Service af52df
    exit 0
Packit Service af52df
fi
Packit Service af52df
Packit Service af52df
# If not run from automake, fake it
Packit Service af52df
if [ -z "$top_srcdir" ]; then
Packit Service af52df
    top_srcdir="$(dirname "$0")/.."
Packit Service af52df
fi
Packit Service af52df
Packit Service af52df
if [ -z "$top_builddir" ] ; then
Packit Service af52df
    top_builddir="$(dirname "$0")/.."
Packit Service af52df
fi
Packit Service af52df
Packit Service af52df
# Make sure libbytesize.pot is up to date
Packit Service af52df
make -C ${top_builddir}/po libbytesize.pot-update >/dev/null 2>&1
Packit Service af52df
Packit Service af52df
PYTHONPATH="${PYTHONPATH}:${top_srcdir}/translation-canary"
Packit Service af52df
export PYTHONPATH
Packit Service af52df
Packit Service af52df
# Run the translatable tests on the POT file
Packit Service af52df
python3 -m translation_canary.translatable "${top_builddir}/po/libbytesize.pot"