Browse Source

Improve check-full

* tests/atlocal.in: Download external archives to $abs_builddir/download.
(tarball_prereq): Create destination directory if necessary.
* tests/.gitignore: Add download
Sergey Poznyakoff 9 years ago
parent
commit
c440a92627
2 changed files with 13 additions and 7 deletions
  1. 1 0
      tests/.gitignore
  2. 12 7
      tests/atlocal.in

+ 1 - 0
tests/.gitignore

@@ -8,3 +8,4 @@ argcv.c
 argcv.h
 genfile.c
 genfile
+download

+ 12 - 7
tests/atlocal.in

@@ -25,7 +25,7 @@ trap "test -r $XFAILFILE && cat $XFAILFILE; exit $?" 1 2 13 15
 
 TEST_DATA_URL=ftp://download.gnu.org.ua/pub/tests/tar
 if test -z "$TEST_DATA_DIR"; then
-  TEST_DATA_DIR=$abs_builddir
+  TEST_DATA_DIR=$abs_builddir/download
 fi
 
 STAR_DATA_URL=$TEST_DATA_URL/star
@@ -35,12 +35,17 @@ fi
 
 # tarball_prereq file sum dir url
 tarball_prereq() {
-  if test -d "$3"; then
-    if test -r $3/$1; then
-      :
-    elif test -n "$FULL_TEST"; then
-      wget -q -O $3/$1 $4/$1
-    fi
+  if ! test -d "$3"; then
+    mkdir "$3"
+    cat > "$3/README" <<EOF
+This directory contains test data downloaded during full check.
+You can remove it, if you wish.
+EOF
+  fi
+  if test -r $3/$1; then
+    :
+  elif test -n "$FULL_TEST"; then
+    wget -q -O $3/$1 $4/$1
   fi
   echo "$2  $3/$1" | md5sum --status --check - >/dev/null 2>&1
 }