bsdcontrol.rb/bin/run-superuser-tests

37 lines
643 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 00:27:20 +01:00
rake clean clobber compile
2024-03-08 02:28:48 +01:00
rm -rf tmp/
2024-03-08 00:27:20 +01:00
for file in test/superuser/*_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 00:27:20 +01:00
done
2024-05-13 02:16:56 +02:00
echo
2024-03-08 00:27:20 +01:00
else
2024-05-13 02:16:56 +02:00
echo "This script must be run by root"
2024-03-08 00:27:20 +01:00
exit 1
fi