Blame tests/canary_tests.sh

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