summaryrefslogtreecommitdiff
path: root/tests/crawl-test.sh
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-06-02 17:46:48 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-06-02 17:46:48 +0000
commit41c5abebb2a3c77eb0494d7a436cb1bea2f7a6c2 (patch)
tree95d410a66e651a286811db58d4b4cc7c6fd9982e /tests/crawl-test.sh
parentf23e4b0ce677a08665ec7f3e662569e12326913b (diff)
More tests!
Diffstat (limited to 'tests/crawl-test.sh')
-rwxr-xr-xtests/crawl-test.sh34
1 files changed, 31 insertions, 3 deletions
diff --git a/tests/crawl-test.sh b/tests/crawl-test.sh
index 8713325..370fb57 100755
--- a/tests/crawl-test.sh
+++ b/tests/crawl-test.sh
@@ -68,7 +68,7 @@ function start-crawl {
;;
--no-purge|--summary)
;;
- --errors|--files)
+ --errors|--files|--found|--not-found|--directory)
pos=$[${pos}+1]
test "$#" -ge "$pos" || warning "missing argument" || return 1
;;
@@ -127,12 +127,40 @@ function start-crawl {
;;
--errors)
shift
- test "$#" -gt 0 || warning "missing argument" || return 1
assert_equals "checking errors" "$1" "$(grep -iEc "^[0-9\:]*[[:space:]]Error:" "${tmp}/hts-log.txt")"
;;
+ --found)
+ shift
+ info "checking for $1"
+ if test -f "${tmp}/$1" ; then
+ result "OK"
+ else
+ result "not found"
+ exit 1
+ fi
+ ;;
+ --not-found)
+ shift
+ info "checking for $1"
+ if test -f "${tmp}/$1" ; then
+ result "OK"
+ else
+ result "not found"
+ exit 1
+ fi
+ ;;
+ --directory)
+ shift
+ info "checking for $1"
+ if test -d "${tmp}/$1" ; then
+ result "OK"
+ else
+ result "not found"
+ exit 1
+ fi
+ ;;
--files)
shift
- test "$#" -gt 0 || warning "missing argument" || return 1
nFiles=$(grep -E "^HTTrack Website Copier/[^ ]* mirror complete in " "${tmp}/hts-log.txt" \
| sed -e 's/.*[[:space:]]\([^ ]*\)[[:space:]]files written.*/\1/g')
assert_equals "checking files" "$1" "$nFiles"