bsdcontrol.rb/bin/run-unprivileged-tests

36 lines
649 B
Text
Raw Normal View History

2024-03-08 00:27:20 +01:00
#!/bin/sh
set -e
2024-05-13 02:16:56 +02:00
##
# functions
run_test()
{
testfile="${1}"
logfile="${2}"
ruby -Ilib \
"${testfile}" \
--no-use-color \
> "${logfile}" 2>&1
}
##
# main
if [ "$(id -u)" != "0" ]; then
2024-03-08 02:28:48 +01:00
rake clean clobber compile
2024-05-13 03:49:15 +02:00
for file in test/unprivileged/*_test.rb; do
2024-05-13 02:16:56 +02:00
logfile=".runner.log_$(basename ${file})"
if run_test "${file}" "${logfile}"; then
echo -n .
rm "${logfile}"
else
cat "${logfile}"
rm "${logfile}"
exit 1
fi
2024-03-08 02:28:48 +01:00
done
2024-05-13 02:16:56 +02:00
echo
2024-03-08 02:28:48 +01:00
else
2024-05-13 02:16:56 +02:00
echo "This script must be run by a user other than root"
2024-03-08 02:28:48 +01:00
exit 1
fi