File tree Expand file tree Collapse file tree 5 files changed +23
-16
lines changed Expand file tree Collapse file tree 5 files changed +23
-16
lines changed Original file line number Diff line number Diff line change 3
3
echo_bpm_variables_posix () {
4
4
cat << -EOF
5
5
# bpm variables
6
- export BPM_ROOT="$BPM_ROOT "
7
- export BPM_REPO_ROOT="$BPM_ROOT /source"
6
+ export BPM_REPO_ROOT="$BPM_REPO_ROOT "
8
7
export BPM_CELLAR="$BPM_CELLAR "
9
8
10
9
EOF
@@ -52,8 +51,7 @@ do-init() {
52
51
fish)
53
52
cat << -EOF
54
53
# bpm variables
55
- set -gx BPM_ROOT $BPM_ROOT
56
- set -gx BPM_REPO_ROOT $BPM_ROOT /source
54
+ set -gx BPM_REPO_ROOT $BPM_REPO_ROOT
57
55
set -gx BPM_CELLAR $BPM_CELLAR
58
56
59
57
# bpm completion
Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ load 'util/init.sh'
11
11
}; test_util.finish_pkg
12
12
test_util.mock_add " $pkg "
13
13
14
- BPM_ROOT=" $BPM_TEST_DIR "
15
-
16
14
source bpm-load
17
15
run bpm-load --global " $pkg "
18
16
Original file line number Diff line number Diff line change 3
3
load ' ./util/init.sh'
4
4
5
5
@test " exports BPM_ROOT" {
6
- unset BPM_ROOT
7
- eval " $( BPM_ROOT=/lol do-init bash) "
6
+ BPM_REPO_ROOT=" $BPM_TEST_REPO_ROOT /../source"
7
+ BPM_CELLAR=" $BPM_TEST_REPO_ROOT /../cellar"
8
+
9
+ eval " $( BPM_REPO_ROOT=/lol do-init bash) "
8
10
9
11
assert_success
10
- assert [ " $BPM_ROOT " = ' /lol' ]
11
- assert test_util.is_exported ' BPM_ROOT '
12
+ assert [ " $BPM_REPO_ROOT " = ' /lol' ]
13
+ assert test_util.is_exported ' BPM_REPO_ROOT '
12
14
}
13
15
14
16
@test " exports BPM_CELLAR" {
15
- unset BPM_ROOT
17
+ unset BPM_CELLAR
16
18
eval " $( BPM_CELLAR=/lol do-init bash) "
17
19
18
20
assert_success
@@ -28,6 +30,9 @@ load './util/init.sh'
28
30
}
29
31
30
32
@test " bash completion works" {
33
+ BPM_REPO_ROOT=" $BPM_TEST_REPO_ROOT /../source"
34
+ BPM_CELLAR=" $BPM_TEST_REPO_ROOT /../cellar"
35
+
31
36
! command -v _bpm
32
37
33
38
eval " $( do-init bash) "
Original file line number Diff line number Diff line change 3
3
load ' util/init.sh'
4
4
5
5
@test " with no arguments, prints an error" {
6
+ BPM_REPO_ROOT=" $BPM_TEST_REPO_ROOT /.."
7
+ BPM_CELLAR=" $BPM_TEST_REPO_ROOT /../cellar"
8
+
6
9
eval " $( do-init sh) "
7
10
8
11
run include
Original file line number Diff line number Diff line change @@ -20,18 +20,21 @@ export BPM_IS_TEST=
20
20
21
21
# Stub common variables
22
22
test_util.get_repo_root
23
- export REPO_ROOT=" $REPLY "
24
- export BPM_ROOT=" ${REPO_ROOT%/* } "
25
- export PROGRAM_LIB_DIR=" $REPO_ROOT /pkg/lib"
23
+ # The root of the real source. This is a separate variable because we want to
24
+ # set 'BPM_ROOT' to some other value
25
+ export BPM_TEST_REPO_ROOT=" $REPLY "
26
+ export PROGRAM_LIB_DIR=" $BPM_TEST_REPO_ROOT /pkg/lib"
27
+
28
+ export BPM_ROOT=" $BPM_TEST_DIR "
26
29
export BPM_CELLAR=" $BPM_TEST_DIR /cellar"
27
30
export BPM_PACKAGES_PATH=" $BPM_CELLAR /packages"
28
31
export BPM_INSTALL_BIN=" $BPM_CELLAR /bin"
29
32
export BPM_INSTALL_MAN=" $BPM_CELLAR /man"
30
33
export BPM_INSTALL_COMPLETIONS=" $BPM_CELLAR /completions"
31
34
export BPM_MODE=' global' # for non-tests, the default is 'local'
32
35
33
- export PATH=" $REPO_ROOT /pkg/bin:$PATH "
34
- for f in " $REPO_ROOT " /pkg/lib/{commands,util}/?* .sh; do
36
+ export PATH=" $BPM_TEST_REPO_ROOT /pkg/bin:$PATH "
37
+ for f in " $BPM_TEST_REPO_ROOT " /pkg/lib/{commands,util}/?* .sh; do
35
38
source " $f "
36
39
done
37
40
You can’t perform that action at this time.
0 commit comments