This repository has been archived on 2026-11-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
docker-openldap/test/tools/run.sh
T
2014-06-18 09:31:50 +02:00

47 lines
656 B
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# Usage
# sudo ./test.sh
# add -v for verbose mode (or type whatever you like !) :p
verbose=$1
error=0
ok=0
echo_start () {
echo "------- Test: $* -------"
}
echo_error () {
echo "\n$(tput setaf 1)/!\ $* failed$(tput sgr0)\n"
error=`expr $error + 1`
}
echo_ok () {
echo "\n--> $* ok\n"
ok=`expr $ok + 1`
}
run_test () {
test=$1
out=test/test.out
echo_start $test
if [ -z ${verbose} ]; then
./test/$test > $out 2>&1
else
./test/$test | tee $out 2>&1
fi
if [ "$(grep -c "$2" $out)" -eq 0 ]; then
echo_error $test
else
echo_ok $test
fi
rm $out
}
./test/tools/prepare.sh > /dev/null 2>&1