summaryrefslogtreecommitdiff
path: root/test/main
blob: a47216ab3f52d78d58990f75bb66c21c684a9d28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 ${1-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}'