Skip to content

Commit

Permalink
fix: make ice zunit test
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
  • Loading branch information
vladdoster committed Dec 10, 2023
1 parent d04bd63 commit 28e95ba
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
23 changes: 13 additions & 10 deletions tests/_support/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,26 @@ ZINIT+=(
# typeset -gxAUH ZINIT=(${(kv)CONFIG})

command git diff > ${ZINIT[HOME_DIR]}/unstaged.diff
info 'creating test env'
# info 'creating test env'
git clone \
--quiet \
--depth=1 \
--dissociate \
--no-hardlinks \
--reference "${GIT_REPO}" \
file://${GIT_REPO:A} \
"${ZINIT[BIN_DIR]}"
"${ZINIT[BIN_DIR]}" >/dev/null
if (( $? != 0 )); then
error "Unable to copy ${GIT_REPO} to ${TMP_ZUNIT}" >&2
exit 1
fi

if [[ -s $ZINIT[HOME_DIR]/unstaged.diff ]]; then
(
git -C $ZINIT[BIN_DIR] apply $ZINIT[HOME_DIR]/unstaged.diff && \
git --quiet -C $ZINIT[BIN_DIR] apply $ZINIT[HOME_DIR]/unstaged.diff && \
chmod g-rwX "${ZINIT[HOME_DIR]}" && \
zcompile "${ZINIT[BIN_DIR]}/zinit.zsh"
)
zcompile "${ZINIT[BIN_DIR]}/zinit.zsh" >/dev/null
) >/dev/null
fi
(( $? != 0 )) && { error "Unable to copy ${GIT_REPO} to ${TMP_ZUNIT}" >&2; exit 1 }

Expand All @@ -67,19 +68,21 @@ builtin hash -d zpfx=$zi_dir/polaris

# ]]]
# Install Annexes [[[
+zi-log '{m} installing test dependencies'
zinit for \
# +zi-log '{m} installing test dependencies'
{
zinit for \
depth'1' \
@zdharma-continuum/zinit-annex-linkman \
depth'1' \
@zdharma-continuum/zinit-annex-default-ice \
ver'feat/logging' \
@zdharma-continuum/zinit-annex-binary-symlink
} >/dev/null
+zi-log "{m} loaded $annex dependencies"
# ]]]

+zi-log '{nl}{bar}'
zinit zstatus
+zi-log '{bar}{nl}'
# +zi-log '{nl}{bar}'
# zinit zstatus
# +zi-log '{bar}{nl}'

# vim:ft=zsh:sw=2:sts=2:et:foldmarker=[[[,]]]:foldmethod=marker
2 changes: 1 addition & 1 deletion tests/ices.zunit
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
assert "$ZPLUGINS/test---atclone/readme.md" not_exists
}
@test 'make' {
run zinit as"null" id-as"test/make" atclone"printf 'all:\n\ttouch whatever\n' > Makefile" make"" for zdharma-continuum/null
run zinit as"null" id-as"test/make" atclone"printf 'all:\n\ttouch whatever\n' > Makefile" make"all" for zdharma-continuum/null
assert $state equals 0
assert "$ZPLUGINS/test---make/whatever" is_file
}
Expand Down
8 changes: 4 additions & 4 deletions zinit-install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2171,7 +2171,7 @@ zimv() {
if [[ ! -e configure || ! -e Makefile ]]; then
+zi-log "{m} ${ice} Attempting to generate configure script... "
local c
for c in "[[ -e autogen.sh ]] && ./autogen.sh" "[[ -n *.a[mc](#qN.) ]] && autoreconf -ifm" "git clean -fxd; aclocal --force; autoconf --force; automake --add-missing --copy --force-missing"; do
for c in "[[ -e autogen.sh ]] && sh ./autogen.sh" "[[ -n *.a[mc](#qN.) ]] && autoreconf -ifm" "git clean -fxd; aclocal --force; autoconf --force; automake --add-missing --copy --force-missing"; do
+zi-log -PrD "{dbg} ${ice} {faint}${c}{rst}"
eval "${c}" 2>/dev/null >&2
if [[ -f configure ]]; then
Expand Down Expand Up @@ -2237,7 +2237,7 @@ zimv() {
fi
local -i ret=0
{
build="command make -C ${dir} --jobs"
build="make -C ${dir} --jobs 4"
+zi-log "{m} ${ice} {faint}${(Ds; ;)build} $make_prefix=$(builtin print -Pnf '%s' ${(D)ZINIT[ZPFX]}){rst}"
+zi-log "{dbg} ${ice} eval ${build} $make_prefix=$prefix 2>/dev/null 1>&2"
eval "${build} $make_prefix=$prefix" 2>/dev/null 1>&2
Expand All @@ -2250,7 +2250,7 @@ zimv() {
}
{
install="${build} ${make}"
+zi-log "{m} ${ice} ${(Ds; ;)build} $make_prefix=$(builtin print -Pnf '%s' ${(D)ZINIT[ZPFX]}) ${make} {rst}"
+zi-log "{m} ${ice} {faint}${(Ds; ;)build} $make_prefix=$(builtin print -Pnf '%s' ${(D)ZINIT[ZPFX]}) ${make} {rst}"
+zi-log "{dbg} ${ice} eval ${build} $make_prefix=$prefix ${make} 2>/dev/null 1>&2"
eval "${(s; ;)install} $make_prefix=$prefix" 2>/dev/null 1>&2
ret=$?
Expand Down Expand Up @@ -2294,7 +2294,7 @@ __zinit-cmake-base-hook () {
local c ret=0 ice='{b}cmake{rst}:'
for c in "-S ${dir} -B ${dir}/build -DCMAKE_BUILD_TYPE=Release --install-prefix ${ZINIT[ZPFX]} ${QUIET}" "--build ${dir}/build --parallel $(nproc) ${QUIET}" "--install ${dir}/build ${QUIET}"; do
+zi-log "{m} ${ice} {faint}cmake ${(Ds; ;)c} {rst}"
eval "command cmake ${c}" 2> /dev/null >&2
eval "cmake ${c}" 2> /dev/null >&2
if (( $? )); then
+zi-log "{e} ${ice} Failure cmake ${c}{rst}"
ret=$?
Expand Down

0 comments on commit 28e95ba

Please sign in to comment.