X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=cgi-auth-flexible.git;a=blobdiff_plain;f=tests%2Fautotest;h=4fc506835f9dc6365ccbb70b5944187160f3aabe;hp=525d1fdedc6de6feb2f1941fc4eb9d952b11bbb7;hb=HEAD;hpb=44cd7013424bdd3811550a47aeff9d01a2a9ce8e diff --git a/tests/autotest b/tests/autotest index 525d1fd..4fc5068 100755 --- a/tests/autotest +++ b/tests/autotest @@ -51,7 +51,7 @@ proc timeout-abort {} { send_log "\r\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" error "$id: aborting due to timeout" } -set timeout 10 +set timeout 15 proc elog {args} { global id @@ -98,6 +98,71 @@ proc loginas {user {password sesame} {wanttxt ACCESSGRANTED}} { submitform-expect $wanttxt } +proc srcdump-prep {} { + global timeout env + set env(CAFTEST_NOSRCDUMP) 0 + set timeout [expr {$timeout * 3}] +} + +proc srcdump-save-check {} { + global tt + global outertar sd files + + 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" + } + } +} + source $testfile puts "$id: ok"