-
Notifications
You must be signed in to change notification settings - Fork 220
/
Copy pathlib-tests.zsh
73 lines (50 loc) · 1.71 KB
/
lib-tests.zsh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
PERLBREW_E2E=/tmp/e2e
export PERLBREW_ROOT=$PERLBREW_E2E/root
export PERLBREW_HOME=$PERLBREW_E2E/home
PERLBREW=$PERLBREW_ROOT/bin/perlbrew
e2e-begin() {
mkdir $PERLBREW_E2E
mkdir $PERLBREW_ROOT
mkdir $PERLBREW_HOME
echo 'E2E BEGIN -- preapre $PERLBREW_E2E'
}
e2e-end() {
rm -rf $PERLBREW_E2E
echo 'E2E END -- cleanup $PERLBREW_E2E'
}
test-perlbrew-self-install() {
echo 'TEST - perlbrew self-install'
assert-file-missing $PERLBREW_ROOT/bin/perlbrew
assert-ok ./perlbrew self-install
assert-file-exists $PERLBREW_ROOT/bin/perlbrew
$PERLBREW_ROOT/bin/perlbrew install-patchperl
assert-file-exists $PERLBREW_ROOT/bin/patchperl
eval "$($PERLBREW init-in-bash)"
}
test-perlbrew-install() {
local installation=$1
shift
echo "TEST - perlbrew install $installation"
assert-file-exists $PERLBREW
assert-dir-missing $PERLBREW_ROOT/perls/$installation
if [[ -n "$PERLBREW_E2E_INSTALL_NOTEST" ]]
then
$PERLBREW install --verbose --notest $installation
else
$PERLBREW install --verbose $installation
fi
assert-dir-exists $PERLBREW_ROOT/perls/$installation
assert-file-exists $PERLBREW_ROOT/perls/$installation/bin/perl
assert-ok $PERLBREW_ROOT/perls/$installation/bin/perl -v
echo "OK - perlbrew install $installation"
}
test-perlbrew-uninstall() {
local installation=$1
shift
echo "TEST - perlbrew uninstall $installation"
assert-dir-exists $PERLBREW_ROOT/perls/$installation
assert-file-exists $PERLBREW_ROOT/perls/$installation/bin/perl
$PERLBREW uninstall --verbose --yes $installation
assert-dir-missing $PERLBREW_ROOT/perls/$installation
echo "OK - perlbrew uninstall $installation"
}