35 lines
584 B
Bash
Executable File
35 lines
584 B
Bash
Executable File
#!/bin/sh
|
|
|
|
recurse() {
|
|
potential_test="$1"
|
|
if [ -d "$potential_test" ]
|
|
then
|
|
(
|
|
cd "$potential_test"
|
|
[ -f setup ] && . ./setup
|
|
for test in *
|
|
do recurse "${test}"
|
|
done
|
|
[ -f teardown ] && [ -x teardown ] && ./teardown
|
|
)
|
|
elif [ -x "$potential_test" ]
|
|
then
|
|
./"$potential_test"
|
|
if [ "$?" = '0' ]
|
|
then
|
|
# Print a '.'
|
|
echo -n .
|
|
else
|
|
# Print a red 'F'
|
|
echo -ne '\033[31mF'
|
|
echo -ne "\033[0m"
|
|
echo -n "(${potential_test})"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
echo Running tests
|
|
recurse .
|
|
echo
|
|
echo Done
|