Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/test-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ jobs:
- name: Install zunit
run: |
mkdir -p bin
curl -fsSL 'https://raw.githubusercontent.com/zdharma/revolver/v0.2.4/revolver' > bin/revolver
curl -fsSL 'https://raw.githubusercontent.com/zdharma/color/d8f91ab5fcfceb623ae45d3333ad0e543775549c/color.zsh' > bin/color
git clone --depth 1 --branch v0.8.2 https://github.com/zdharma/zunit.git zunit.git
curl -fsSL 'https://raw.githubusercontent.com/z-shell/src/9335c8c14e0aaa845277f882969c146755e1241e/lib/zsh/snippets/revolver' > bin/revolver
curl -fsSL 'https://raw.githubusercontent.com/z-shell/src/9335c8c14e0aaa845277f882969c146755e1241e/lib/zsh/snippets/color.zsh' > bin/color
# ZUnit 0.8.2 as released (bce183c). z-shell/zunit's own v0.8.2 tag
# re-evaluates run arguments, which tests/helpers.zsh does not expect yet.
git init zunit.git
git -C zunit.git remote add origin https://github.com/z-shell/zunit.git
git -C zunit.git fetch --depth 1 origin bce183c39a3b51a3dd838835516a37222aad921f
git -C zunit.git checkout --detach FETCH_HEAD
cd zunit.git && ./build.zsh && cd ..
mv zunit.git/zunit bin/
chmod u+x bin/{color,revolver,zunit}
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,9 @@ NEWS.md
Untitled-1.sh
CLAUDE.md
GEMINI.md

# Test tools installed by `make bin/zunit` and test-native.yml; never committed.
/bin/color
/bin/revolver
/bin/zunit
/bin/.tools-*
22 changes: 17 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ IMAGE ?= ghcr.io/z-shell/zd
TAG ?= latest
TERM ?= xterm-256color
TEST_FILES = annexes compat ice packages plugins shell-state snippets utils
# Test tool revisions. The stamp is named after both, so changing either
# reinstalls bin/ on the next `make test`.
ZUNIT_COMMIT := bce183c39a3b51a3dd838835516a37222aad921f
SRC_COMMIT := 9335c8c14e0aaa845277f882969c146755e1241e
TOOLS_STAMP := bin/.tools-$(ZUNIT_COMMIT)-$(SRC_COMMIT)

ifdef FILE
_SUITES := tests/$(FILE).zunit
Expand All @@ -17,7 +22,7 @@ endif
.PHONY: test run shell build controlled-build help

## test [FILE=<suite>] — run ZUnit natively (all suites, or one)
test: bin/zunit
test: $(TOOLS_STAMP)
@for f in $(_SUITES); do \
echo "==> $$f"; \
PATH="$(CURDIR)/bin:$$PATH" \
Expand Down Expand Up @@ -67,17 +72,24 @@ controlled-build:
--tag "$(IMAGE):$(PROFILE)-$(ZSH_VERSION)-$(ZSH_PATCH_SET)" .

# Install zunit + helpers into bin/ — mirrors what test-native.yml does in CI.
bin/zunit:
bin/zunit: $(TOOLS_STAMP)

$(TOOLS_STAMP):
@echo "Installing zunit into bin/ ..."
@mkdir -p bin
@curl -fsSL 'https://raw.githubusercontent.com/zdharma/revolver/v0.2.4/revolver' \
@rm -f bin/.tools-*
@curl -fsSL 'https://raw.githubusercontent.com/z-shell/src/$(SRC_COMMIT)/lib/zsh/snippets/revolver' \
> bin/revolver
@curl -fsSL 'https://raw.githubusercontent.com/zdharma/color/d8f91ab5fcfceb623ae45d3333ad0e543775549c/color.zsh' \
@curl -fsSL 'https://raw.githubusercontent.com/z-shell/src/$(SRC_COMMIT)/lib/zsh/snippets/color.zsh' \
> bin/color
@rm -rf /tmp/zunit.git
@git clone --depth 1 https://github.com/zdharma/zunit.git /tmp/zunit.git
@git init -q /tmp/zunit.git
@git -C /tmp/zunit.git remote add origin https://github.com/z-shell/zunit.git
@git -C /tmp/zunit.git fetch -q --depth 1 origin $(ZUNIT_COMMIT)
@git -C /tmp/zunit.git checkout -q --detach FETCH_HEAD
@cd /tmp/zunit.git && ./build.zsh
@mv /tmp/zunit.git/zunit bin/zunit
@chmod u+x bin/color bin/revolver bin/zunit
@rm -rf /tmp/zunit.git
@touch $@
@echo "Done."
29 changes: 0 additions & 29 deletions bin/color

This file was deleted.

Loading
Loading