You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make install.sh sourceable; unit-test its helpers (#23)
install.sh's release-resolution had no automated coverage: e2e installs
a local .deb via CLAUDE_CODE_DEB, skipping the download/parse path.
- Extract release-JSON parsing into a pure asset_url() helper; move the
install flow into main() behind a CLAUDE_CODE_INSTALL_LIB guard so the
unit test can source the helpers without running it (curl | bash still
runs main).
- Add test/install_test.sh: hermetic shUnit2 tests for the helpers (no
network/apt), exercising the no-match guard under pipefail.
- Split test:fast into an aggregator over test:greatest (the C launcher)
and test:shunit2; greatest defaults to -v.
- Keep the temp-.deb EXIT trap working under set -u: deb stays
script-global, since a local would be out of scope when the trap fires.
Seam for verifying the download against the release asset digest (#18),
which reapplies as a sibling asset_digest() helper plus its cases.
Copy file name to clipboardExpand all lines: AGENTS.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ publish the binary; the `.deb` contains no Anthropic bytes.
56
56
57
57
| Path | Role |
58
58
|---|---|
59
-
|`install.sh`| Single install path. Downloads the latest release `.deb` (or installs a local one via `CLAUDE_CODE_DEB=<path>`), enables `glibc-repo`, `apt install`s it. |
59
+
|`install.sh`| Single install path. Downloads the latest release `.deb` (or installs a local one via `CLAUDE_CODE_DEB=<path>`), enables `glibc-repo`, `apt install`s it. The install flow is in `main` behind a `CLAUDE_CODE_INSTALL_LIB` guard so the unit test can source its pure helpers without running it (and `curl \| bash` still runs `main`). |
|`package/postinst`| Settings merge (skip via `CLAUDE_CODE_SKIP_SETTINGS`) + native-path symlink (via `link-native.sh`) + fetch the binary. |
62
62
|`package/postrm`| Removes the fetched binary and the native-path symlink on uninstall. |
@@ -68,9 +68,10 @@ publish the binary; the `.deb` contains no Anthropic bytes.
68
68
|`src/claude-wrapper.c`| The C launcher (`-DBINARY=`/`-DTMPDIR_PATH=`/`-DUNAME_SHIM=` baked in at compile). `claude_wrapper_run()` takes its exec function as a parameter — a seam the unit tests fake. |
69
69
|`src/uname-shim.c`| Freestanding `LD_PRELOAD``uname()` interposer reporting kernel `5.10.0`, so Bun avoids the `epoll_pwait2` startup segfault (bun#32489). Built by `build-wrapper.sh`, shipped to `lib/claude-code-termux/uname-spoof.so`, preloaded by the launcher. |
70
70
|`test/wrapper_test.c`| Unit tests for the launcher (greatest; recording exec stub). |
71
+
|`test/install_test.sh`| Hermetic unit tests for `install.sh`'s pure helpers (shUnit2; no network/apt). |
71
72
|`test/compat.h`| Test-only `setenv`/`unsetenv` shims for Windows libc; force-included into the test build, never shipped. |
72
73
|`vendor/greatest.h`| Vendored single-header test framework (greatest 1.5.0, ISC; from silentbicycle/greatest). |
73
-
|`vendor/shunit2`| Vendored single-file shell test framework (shUnit2 2.1.9pre, Apache-2.0; pinned to kward/shunit2 master @ `f39734a` — no tagged release since 2.1.8, and master carries the `egrep`→`grep -E` fix we'd otherwise patch). Drives `scripts/e2e.sh`. Carries one local patch (grep `PATCHED FOR TERMUX`; re-apply on bump): `#! /bin/sh` stub scripts → resolve `sh` via PATH (submitted upstream as kward/shunit2#189). |
74
+
|`vendor/shunit2`| Vendored single-file shell test framework (shUnit2 2.1.9pre, Apache-2.0; pinned to kward/shunit2 master @ `f39734a` — no tagged release since 2.1.8, and master carries the `egrep`→`grep -E` fix we'd otherwise patch). Drives `scripts/e2e.sh` and `test/install_test.sh`. Carries one local patch (grep `PATCHED FOR TERMUX`; re-apply on bump): `#! /bin/sh` stub scripts → resolve `sh` via PATH (submitted upstream as kward/shunit2#189). |
74
75
|`scripts/build-wrapper.sh`| Compile the wrapper + uname shim with Termux's clang. |
0 commit comments