Improve test output
This commit is contained in:
parent
6d0bccc3ed
commit
fafc20c06b
2 changed files with 54 additions and 6 deletions
|
@ -1,12 +1,36 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
if [ $(id -u) = 0 ]; then
|
||||
|
||||
##
|
||||
# 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
|
||||
ruby -Ilib ${file} --no-use-color
|
||||
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 "You must be the root user to run these tests."
|
||||
echo "This script must be run by root"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -1,11 +1,35 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
if [ $(id -u) -ne 0 ]; then
|
||||
|
||||
##
|
||||
# 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
|
||||
for file in test/readme_examples_test.rb test/unprivileged/*_test.rb; do
|
||||
ruby -Ilib ${file} --no-use-color
|
||||
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 "You must be an unprivileged user to run these tests."
|
||||
echo "This script must be run by a user other than root"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue