69 lines
3.0 KiB
Plaintext
69 lines
3.0 KiB
Plaintext
=== tofu smoketest ===
|
|
|
|
step 0: build tofu binary... [32mPASS[0m
|
|
step 1: create temp workspace and hello binary... [32mPASS[0m
|
|
step 2: create hello.recipe... [32mPASS[0m
|
|
step 3: create package.lua... [32mPASS[0m
|
|
step 4: create fake zeta-makepkg and zeta... [32mPASS[0m
|
|
step 5: create mock ZUUR layout... [32mPASS[0m
|
|
step 6: start mock ZUUR http server... [32mPASS[0m
|
|
ZUUR_URL=http://127.0.0.1:27644
|
|
CACHE_DIR=/tmp/tmp.707gC0rrPK/cache
|
|
|
|
step 7: tofu -Ss hello (search)... [32mPASS[0m
|
|
step 8: tofu -S hello --noconfirm (install)... [2m . fetching index http://127.0.0.1:27644/index.lua[0m
|
|
[32m ok index loaded: 1 packages[0m
|
|
[36m==> fetching recipe hello[0m
|
|
[2m . downloading hello.recipe[0m
|
|
[2m . downloading package.lua[0m
|
|
[2m . downloading build.sh[0m
|
|
- no build.sh for hello (optional build script)
|
|
[32m ok recipe hello downloaded[0m
|
|
[36m==> generating build plan[0m
|
|
- + hello (recipe)
|
|
[32m ok build plan: 1 packages[0m
|
|
- will build 1 package(s): hello
|
|
[36m==> ──── building hello (1/1) ────[0m
|
|
[32m ok hello[0m
|
|
installing hello-1.0[32m ok installed hello with 0 dependencies[0m
|
|
[32m ok installed 1 package(s)[0m
|
|
installed.json check... [32mPASS[0m
|
|
binary in root check... [32mPASS[0m
|
|
step 9: tofu -Syu --noconfirm (upgrade — nothing to do)... [32mPASS[0m
|
|
step 10: tofu -Si hello (info)... [32mPASS[0m
|
|
step 11: tofu -R hello --noconfirm (remove)... removing hello[32m ok removed hello[0m
|
|
binary removed check... [32mPASS[0m
|
|
installed.json cleared check... [32mPASS[0m
|
|
step 12: tofu -S nonexistent --noconfirm (expect exit 2)... [2m . fetching index http://127.0.0.1:27644/index.lua[0m
|
|
[32m ok index loaded: 1 packages[0m
|
|
[32mPASS[0m
|
|
step 13: cleanup... [32mPASS[0m
|
|
|
|
=== smoketest complete ===
|
|
PASS: 16 checks passed
|
|
All checks passed.
|
|
|
|
=== FIX (task 27): info.d unsigned indexOf wrap ===
|
|
Bug: src/tofu/commands/info.d:93 — `size_t pos = content.indexOf("deps")`.
|
|
indexOf returns ptrdiff_t (-1 for not found); unsigned size_t wraps -1 to
|
|
SIZE_MAX, making `if (pos < 0)` a no-op → ArrayIndexError on recipes
|
|
without a deps field (uncaught D Error, crashed -Si).
|
|
|
|
Fix applied:
|
|
1. scanDepsArray: size_t pos → ptrdiff_t pos (+ explanatory comment).
|
|
2. Added regression unittest (Test 4): cached recipe WITHOUT deps field
|
|
(name/ver/summary/build_system only) → infoCommand returns 0.
|
|
Recipe written via existing writeRecipe helper, mirrors Test 3 pattern.
|
|
|
|
Audit of same pattern elsewhere (checked, NOT bugs):
|
|
- info.d:36 auto kp = ...indexOf(key) → auto infers ptrdiff_t ✓
|
|
- recipeparse.d:52,112 auto idx = indexOf(...) → ptrdiff_t ✓
|
|
- fetch.d:82 auto idx = indexOf(...) → ptrdiff_t ✓
|
|
- search.d / remove.d / install.d → inline >= 0 / == -1 ✓
|
|
No other unsigned indexOf assignment found.
|
|
|
|
Verification:
|
|
dub build → Linking tofu (pass)
|
|
dub test → 23 modules passed unittests
|
|
smoketest → PASS: 16 checks passed, All checks passed.
|