chiark / gitweb /
Testing: Introduce CAFTEST_SRCDUMP_NEEDLOGIN
[cgi-auth-flexible.git] / tests / srcdump-loginback.at
index 76554ab507d1b974911d0d1b32dd53354147fb88..f02ffae3dd62e7558a2f44dd29c860234ca2f678 100644 (file)
@@ -17,9 +17,8 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU Affero General Public License for more details.
 
-set env(CAFTEST_NOSRCDUMP) 0
-
-set timeout [expr {$timeout * 3}]
+set env(CAFTEST_SRCDUMP_NEEDLOGIN) 1
+srcdump-prep
 
 dospawn
 
@@ -29,56 +28,4 @@ send "B/source available\r\r"
 
 etxt "Save file to"
 
-set outertar $tt/t-srcdump.tgz
-set sd $tt/t-srcdump.d
-
-send "\x15$outertar\r"
-etxt "Download complete"
-
-exec mkdir $sd
-
-set files [exec tar -C $sd -zvxf - < $outertar]
-
-foreach f {
-    manifest.txt
-    licence.data       
-    cgi-auth-flexible.pm
-    .gitignore
-} {
-    set got($f) 0
-}
-
-if {[file exists .git]} {
-    set got(.git/objects/) 0
-}
-
-foreach f $files {
-    switch -glob -- $f {
-       licence.data - manifest.txt {
-           set got($f) 1
-       }
-       *.tar {
-           foreach g [exec tar -C $sd -tf - < $sd/$f] {
-               switch -glob -- $g {
-                   cgi-auth-flexible.pm - .gitignore - .git/objects/ {
-                       set got($g) 1
-                   }
-                   *~ {
-                       error "file $g inside $f !"
-                   }
-                   .git/* {
-                   }
-                   *.db {
-                       error "file $g inside $f outside .git !"
-                   }
-               }
-           }
-       }
-    }
-}
-
-foreach g [array names got] {
-    if {!$got($g)} {
-       error "file $g missing"
-    }
-}
+srcdump-save-check