box-o-sand/lcthw-remnants-2/runtests

32 lines
740 B
Plaintext
Raw Normal View History

2016-04-13 13:41:20 +00:00
#!/usr/bin/env bash
2016-04-13 14:36:55 +00:00
set -e
[[ $DEBUG ]] && set -x
test_ex17-ec() {
local testdb=$(mktemp /var/tmp/XXXXXXX.dat)
trap "rm ${testdb}" EXIT INT TERM
./ex17-ec "${testdb}" c
./ex17-ec "${testdb}" l &>/dev/null
./ex17-ec "${testdb}" s 1 nancy pwnr@dungeon.info "Dark corner"
./ex17-ec "${testdb}" s 2 fran eagleeye16@hotmail.com "Falcon's nest"
./ex17-ec "${testdb}" l &>/dev/null
./ex17-ec "${testdb}" d 1
./ex17-ec "${testdb}" s 1 portia wanda@aeromar.mx "Fancy town"
./ex17-ec "${testdb}" f nest &>/dev/null
echo "OK"
}
main() {
for ex in $(./list-exercises) ; do
func_name="test_${ex}"
if type "${func_name}" &>/dev/null ; then
echo -en "---> ${ex}: "
"${func_name}"
fi
done
}
main "$@"