summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-04-10 21:04:03 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-04-10 21:04:03 +0200
commit6db26e288eb85e36729878f88295972870d104f6 (patch)
treebaeb01849dabd29047ceadd2a108a3717be89ada
parent86f2151b6fd877061408743bac30b52d48cfee31 (diff)
Added a little test (to be extended, currently mainly tests bootstrap)
-rwxr-xr-xtest/main32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/main b/test/main
new file mode 100755
index 0000000..d512352
--- /dev/null
+++ b/test/main
@@ -0,0 +1,32 @@
+#!/usr/bin/env zsh
+setopt err_exit
+
+test_pdir=$(mktemp -dt pkgdir.XXXXXX)
+test_proot=$(mktemp -dt pkgroot.XXXXXX)
+test_home=$(mktemp -dt pkghome.XXXXXX)
+
+cat << meow
+test directories:
+ PDIR = $test_pdir
+ PKG_ROOT = $test_proot
+ HOME = $test_home
+meow
+
+echo "# setting up PKG_ROOT"
+cd $test_proot
+git clone git://git.tabularazor.org/~derf/pkg core
+cp core/include/pkglist pkglist
+
+echo "# bootstrapping PDIR"
+cd $test_home
+export HOME=$test_home
+$test_proot/core/include/bootstrap $test_proot $test_pdir
+
+echo "# checking for success"
+[[ -e $test_home/.pkg.conf ]]
+[[ -d $test_proot/core ]]
+[[ -d $test_pdir/core ]]
+
+rm -rf $test_pdir $test_proot $test_home
+
+print -P '%F{green} test passed%F{default}'