summaryrefslogtreecommitdiff
path: root/test/main
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-04-16 13:07:52 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-04-16 13:07:52 +0200
commitd7917f30992c405bcac520a3894dcb4ff503b1d3 (patch)
tree98bc3c189b5fe149b6413cc8907264a6b43946df /test/main
parentc89449977d08ce5b60fd08c2f2c7a89dc899261b (diff)
Added tests for bare repositories in PKG_ROOT
Diffstat (limited to 'test/main')
-rwxr-xr-xtest/main96
1 files changed, 56 insertions, 40 deletions
diff --git a/test/main b/test/main
index e699382..b98c65e 100755
--- a/test/main
+++ b/test/main
@@ -34,6 +34,12 @@ for repo in ra rb rc; (
chmod 755 bin/$repo
git add .
git commit -m 'initial commit'
+ cd ..
+ mkdir ${repo}-bare
+ cd ${repo}-bare
+ git --bare init
+ cd ../$repo
+ git push ../${repo}-bare master
)
echo "# bootstrapping PDIR"
@@ -58,10 +64,10 @@ stringcmp "core" "$(pkg list)"
stringcmp "core" "$(pkg list local)"
echo "# pkg list not-installed"
-stringcmp "ra\nrb\nrc" "$(pkg list not-installed)"
+stringcmp "ra\nra-bare\nrb\nrb-bare\nrc\nrc-bare" "$(pkg list not-installed)"
echo "# pkg list all"
-stringcmp "core\nra\nrb\nrc" "$(pkg list all)"
+stringcmp "core\nra\nra-bare\nrb\nrb-bare\nrc\nrc-bare" "$(pkg list all)"
echo "# pkg add (no such repo)"
! pkg add weltfrieden
@@ -69,44 +75,54 @@ echo "# pkg add (no such repo)"
echo "# pkg add (already installed)"
! pkg add core
-echo "# pkg add (ok)"
-pkg add ra
-[[ -e $test_pdir/ra/foo ]]
-[[ -d $test_pdir/ra/.git ]]
-
-echo "# pkg add (already installed)"
-! pkg add ra
-
-echo "# populate_collected"
-[[ -L $test_home/bin/ra ]]
-[[ -x $(readlink $test_home/bin/ra) ]]
-[[ -e $test_pdir/.collected/man/man2/ra.2 ]]
-
-repeat 2 {
- echo "# pkg list"
- stringcmp "core\nra" "$(pkg list local)"
- stringcmp "rb\nrc" "$(pkg list not-installed)"
- stringcmp "core\nra\nrb\nrc" "$(pkg list remote)"
- pkg update
-}
-
-echo "# pkg remove (not installed/nonexistent)"
-! pkg remove suckage
-! pkg remove rb
-
-echo "# pkg remove (ok)"
-pkg remove ra
-
-echo "# genocide_collected (~/bin)"
-[[ ! -L $test_home/bin/ra ]]
-[[ ! -e $test_pdir/.collected/man/man2/ra.2 ]]
-
-repeat 2 {
- echo "# pkg list"
- stringcmp "core" "$(pkg list local)"
- stringcmp "ra\nrb\nrc" "$(pkg list not-installed)"
- stringcmp "core\nra\nrb\nrc" "$(pkg list remote)"
- pkg update
+for repo in ra ra-bare; {
+ file=${repo%-*}
+ if [[ $repo == *-bare ]] {
+ echo "## bare repository"
+ complement=$file
+ } else {
+ echo "## non-bare repository"
+ complement=${repo}-bare
+ }
+ echo "# pkg add (ok)"
+ pkg add $repo
+ [[ -e $test_pdir/$repo/foo ]]
+ [[ -d $test_pdir/$repo/.git ]]
+
+ echo "# pkg add (already installed)"
+ ! pkg add $repo
+
+ echo "# populate_collected"
+ [[ -L $test_home/bin/$file ]]
+ [[ -x $(readlink $test_home/bin/$file) ]]
+ [[ -e $test_pdir/.collected/man/man2/$file.2 ]]
+
+ repeat 2 {
+ echo "# pkg list"
+ stringcmp "core\n$repo" "$(pkg list local)"
+ stringcmp "$complement\nrb\nrb-bare\nrc\nrc-bare" "$(pkg list not-installed)"
+ stringcmp "core\nra\nra-bare\nrb\nrb-bare\nrc\nrc-bare" "$(pkg list remote)"
+ pkg update
+ }
+
+ echo "# pkg remove (not installed/nonexistent)"
+ ! pkg remove suckage
+ ! pkg remove rb
+
+ echo "# pkg remove (ok)"
+ pkg remove $repo
+
+ echo "# genocide_collected (~/bin)"
+ [[ ! -L $test_home/bin/$file ]]
+ [[ ! -e $test_pdir/.collected/man/man2/$file.2 ]]
+
+ repeat 2 {
+ echo "# pkg list"
+ stringcmp "core" "$(pkg list local)"
+ stringcmp "ra\nra-bare\nrb\nrb-bare\nrc\nrc-bare" "$(pkg list not-installed)"
+ stringcmp "core\nra\nra-bare\nrb\nrb-bare\nrc\nrc-bare" "$(pkg list remote)"
+ pkg update
+ }
}
rm -rf $test_pdir $test_proot $test_home