diff --git a/tests/tests.sh b/tests/tests.sh index 96b2672..f7df13f 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh #$Id$ -#Copyright (c) 2012 Pierre Pronchery +#Copyright (c) 2012-2013 Pierre Pronchery #This file is part of DeforaOS Desktop Mailer #This program is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by @@ -25,8 +25,12 @@ _usage() #main -while getopts "P:" "name"; do +clean=0 +while getopts "cP:" name; do case "$name" in + c) + clean=1 + ;; P) #XXX ignored ;; @@ -43,6 +47,8 @@ if [ $# -ne 1 ]; then fi target="$1" +[ "$clean" -ne 0 ] && exit 0 + > "$target" FAILED= ./date >> "$target" || FAILED="$FAILED date(error $?)"