#!/bin/sh
# Run systemd's installed meson unit tests in ptest format.
# systemd's -Dinstall-tests=true installs run-unit-tests.py plus the
# unit-tests/test-* binaries; run-unit-tests.py already emits PASS:/SKIP: lines.
set -u
here="$(cd "$(dirname "$0")" && pwd)"
for cand in "$here/run-unit-tests.py" "$here/tests/run-unit-tests.py" /usr/lib/systemd/tests/run-unit-tests.py; do
    [ -f "$cand" ] && { python3 "$cand" 2>&1; exit 0; }
done
echo "FAIL: systemd-ptest (run-unit-tests.py not found)"
exit 1
