summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-07-09 10:01:27 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-07-09 10:01:27 +0200
commit44dec9057bf976c6da30eceeaa0455693d3c803a (patch)
tree96dd7874694be287c7fa808b62995a0bfa917968 /test
parent09e469c132eb7986188604ff796249bba7d2cfba (diff)
test: Backup an existing store file before testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/main9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/main b/test/main
index 5596a27..dae8878 100755
--- a/test/main
+++ b/test/main
@@ -14,6 +14,7 @@ while [[ $1 == --* ]] {
typeset envstore=${1-bin/envstore}
typeset store_file=${2-/tmp/envstore-$UID}
+typeset backup_file="/tmp/envstore-backup-$UID"
trap "print -P '\n%N:%i: %B%F{red}Test faild!%F{default}%b'" ZERR
trap "$envstore clear" INT
@@ -33,6 +34,10 @@ if ((help)) {
exit 0
}
+if [[ -e $store_file ]] {
+ mv $store_file $backup_file
+}
+
echo "# Documentation"
podchecker -warnings -warnings man/*/*
@@ -150,3 +155,7 @@ if ((test_security)) {
}
print -P '\n%F{green}Test passed%F{default}'
+
+if [[ -e $backup_file ]] {
+ mv $backup_file $store_file
+}