- better handling of failures

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1170 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2003-05-28 13:36:25 +00:00
parent 7b5e8d2ba3
commit 59b07de3d4
1 changed files with 20 additions and 2 deletions

View File

@ -4,9 +4,12 @@ mkdir -p out
scripts=""
options=""
abort_if_fail=true
while [ $# -gt 0 ]; do
opt=$1; shift
case $opt in
--continue)
abort_if_fail=false;;
--reader)
options="$options $opt $1"
shift;;
@ -20,11 +23,26 @@ if [ -z "$scripts" ]; then
fi
for script in $scripts; do
echo -n "${script} ..."
echo -n "${script}... "
if ./$script $options >out/$script 2>&1; then
echo "success"
else
echo "fail"
mkdir -p failed
failed="failed/$script"
rm -rf $failed
mv test-data $failed
echo "fail (test data moved to $failed)"
if $abort_if_fail; then
echo Aborting.
exit 1
fi
echo -n "Wiping card... "
if ./erase $options >out/erase 2>&1; then
echo done
else
echo failed.
exit 1
fi
fi
done