Commits

ZyX_I  committed 1568960

tests: Made tests use *.pre files instead of generating all repositories in one turn

  • Participants
  • Parent commits 74e509f

Comments (0)

Files changed (7)

File test/cmd-other.pre

+#!/bin/zsh
+tar xJf hgtestbranchedrepo.tar.xz
+hg -q clone hgtestbranchedrepo cmd-other-A -r A -r B
+hg -q clone cmd-other-A        cmd-other-B
+hg -q pull -R cmd-other-B hgtestbranchedrepo -r C -r D
+hg -q clone cmd-other-B        cmd-other-C
+hg -q clone hgtestrepo cmd-otherrepo -r 1

File test/drivers-git.pre

+#!/bin/zsh
+tar xJf gittestrepo.tar.xz
+tar xJf gitteststatusrepo.tar.xz
+tar xJf gittestbranchedrepo.tar.xz
+mkdir drivers-git-A && (cd drivers-git-A && tar xJf ../drivers-git-first-two.tar.xz)

File test/drivers-subversion-subdir.pre

+#!/bin/zsh
+mkdir svntestrepo-subdirserver
+tar c -C svntestreposerver . | ( cd svntestrepo-subdirserver && tar x )
+svn checkout -q file://$PWD/svntestrepo-subdirserver/subdir svntest-subdirrepo

File test/drivers-subversion.pre

+#!/bin/zsh
+tar xJf svntestreposerver.tar.xz
+svn checkout -q file://$PWD/svntestreposerver svntestrepo

File test/gentests-setuptestrepos.zsh

     $@ >$LOGFILE
 }
 
-tar xJf hgtestrepo.tar.xz
-tar xJf hgtestbranchedrepo.tar.xz
-
-tar xJf gittestrepo.tar.xz
-tar xJf gitteststatusrepo.tar.xz
-tar xJf gittestbranchedrepo.tar.xz
-mkdir drivers-git-A && (cd drivers-git-A && tar xJf ../drivers-git-first-two.tar.xz)
-
-tar xJf svntestreposerver.tar.xz
-mkdir svntestrepo-subdirserver
-tar c -C svntestreposerver . | ( cd svntestrepo-subdirserver && tar x )
-silent svn checkout file://$PWD/svntestreposerver svntestrepo
-silent svn checkout file://$PWD/svntestrepo-subdirserver/subdir svntest-subdirrepo
+unxz hgtestrepo.tar.xz
+tar xf hgtestrepo.tar
 
 for test in cmd-annotate-buffers cmd+maps-commit cmd-record cmd-status \
             maps-status cmd-vimdiff cmd-diff cmd-update opts-remembermsg \
             opts-vimdiffusewin cmd-vimdiff-full cmdaus
 do
-    mkdir ${test}repo
-    tar c -C hgtestrepo . | (cd ${test}repo && tar x)
+    ln -s util-add-modified-repo.zsh $test.pre
 done
 
-silent hg clone hgtestbranchedrepo cmd-other-A -r A -r B
-silent hg clone cmd-other-A        cmd-other-B
-silent hg pull -R cmd-other-B hgtestbranchedrepo -r C -r D
-silent hg clone cmd-other-B        cmd-other-C
-silent hg clone hgtestrepo cmd-otherrepo -r 1
-
 for test in *.in ; do
-    [[ $test == drivers-* ]] && continue
     test=$test:r
-    [[ -d ${test}repo ]] && continue
-    silent hg clone hgtestrepo ${test}repo
+    test -x $test.pre && continue
+    ln -s util-add-cloned-repo.zsh $test.pre
 done
 # vim: fmr=▶,▲ ts=4 sts=4 sw=4 et

File test/util-add-cloned-repo.zsh

+#!/bin/zsh
+hg -q clone hgtestrepo ${CURTEST}repo

File test/util-add-modified-repo.zsh

+#!/bin/zsh
+mkdir ${CURTEST}repo
+(
+    cd ${CURTEST}repo
+    tar x --strip-components=1 < hgtestrepo.tar
+)