bsdcontrol.rb/bin/run-superuser-tests
2024-05-12 21:28:48 -03:00

36 lines
643 B
Bash
Executable file

#!/bin/sh
set -e
##
# functions
run_test()
{
testfile="${1}"
logfile="${2}"
ruby -Ilib \
"${testfile}" \
--no-use-color \
> "${logfile}" 2>&1
}
##
# main
if [ "$(id -u)" = "0" ]; then
rake clean clobber compile
rm -rf tmp/
for file in test/superuser/*_test.rb; do
logfile=".runner.log_$(basename ${file})"
if run_test "${file}" "${logfile}"; then
echo -n .
rm "${logfile}"
else
cat "${logfile}"
rm "${logfile}"
exit 1
fi
done
echo
else
echo "This script must be run by root"
exit 1
fi