File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 chmod +x extras/test/test-filtering.sh
3232 chmod +x extras/test/test-sieve-import.sh
3333 chmod +x extras/test/test-helpers.sh
34+ chmod +x extras/test/test-bootstrap-paths.sh
3435
3536 - name : Build
3637 run : make
5556
5657 - name : Helper binary tests
5758 run : extras/test/test-helpers.sh
59+
60+ - name : Bootstrap path tests
61+ run : extras/test/test-bootstrap-paths.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env zsh
2+
3+ set -euo pipefail
4+
5+ script_dir=" ${0: A: h} "
6+ source " ${script_dir} /lib/test_helpers.zsh"
7+ test_setup " ${0} "
8+
9+ cleanup () {
10+ test_cleanup
11+ }
12+ trap cleanup EXIT INT TERM
13+
14+ bad_root=" ${tmp_root} /missing-workdir"
15+ mkdir -p " ${bad_root} "
16+
17+ output=" $(
18+ JAROMAILDIR=" ${mail_root} " \
19+ JAROWORKDIR=" ${bad_root} " \
20+ " ${repo_root} /src/jaro" source addr 2>&1
21+ ) "
22+
23+ assert_contains " ${output} " " System in ${repo_root} /src" " bootstrap recovers workdir"
24+ assert_contains " ${output} " " Mail in ${mail_root} " " bootstrap keeps maildir"
Original file line number Diff line number Diff line change 33# Resolve runtime paths and load the core framework + libraries.
44# use GNU/Linux default in local
55WORKDIR=" /usr/local/share/jaromail"
6+ bootstrap_file=" ${(% ):-% x} "
7+ bootstrap_root=" ${bootstrap_file: A: h: h} "
68
79 # check if we are testing from source
810 if [[ -r ../src/jaro ]]; then
@@ -18,6 +20,19 @@ WORKDIR="/usr/local/share/jaromail"
1820 # env override
1921 WORKDIR=${JAROWORKDIR:- $WORKDIR }
2022
23+ # If WORKDIR is blank or does not contain zlibs, derive it from this file.
24+ if [[ -z " $WORKDIR " || ! -d " $WORKDIR /zlibs" ]]; then
25+ if [[ -d " $bootstrap_root /zlibs" ]]; then
26+ WORKDIR=" $bootstrap_root "
27+ fi
28+ fi
29+
30+ # Abort early if no valid runtime path can be found.
31+ if [[ ! -d " $WORKDIR /zlibs" ]]; then
32+ print -u2 " Cannot find Jaro Mail runtime in WORKDIR: ${WORKDIR} "
33+ exit 1
34+ fi
35+
2136 # load our zuper extension
2237 # different load paths from inside source or installed
2338 if [[ -r " $WORKDIR /zuper/zuper" ]]; then
You can’t perform that action at this time.
0 commit comments