Skip to content

Host test suite + coverage report (independent)#4

Closed
d33mobile wants to merge 1 commit into
hakierspejs:masterfrom
d33mobile:chore/tests
Closed

Host test suite + coverage report (independent)#4
d33mobile wants to merge 1 commit into
hakierspejs:masterfrom
d33mobile:chore/tests

Conversation

@d33mobile

Copy link
Copy Markdown

Host test suite (independent)

Base master, shares zero files with the format/lint PR (#2) — the two can be reviewed and merged in any order.

Contents

  • test/ — host harnesses (native Linux ELF) for the hardware-independent logic: harness_secret_qr.c (secret → base32 → otpauth URI → QR, mirroring serial/commands_keys.c) + harness_base64.c (base64 roundtrip). test/Makefile targets asan / valgrind / coverage, needing one host stub (test/stub/pico/rand.h).
  • .github/workflows/test.yml — standalone workflow: ASan+UBSan + Valgrind via make -C test ..., submodules recursive + lcov. No dependency on any other PR.
  • .github/workflows/pages.yml — publishes the coverage report to GitHub Pages.
  • Bug fix — UBSan caught a signed-overflow UB in libs/base32/base32.c (intuint32_t accumulator); the harness is the regression test.

Coverage report

lcov + genhtml over the modules the harnesses exercise (base32, base64, random): 98.4% lines, 84.8% branches. Live from my fork: https://d33mobile.github.io/hslock/

CI status

master has no workflows yet, so GitHub runs no pull_request checks here. Green on my fork (test + pages): d33mobile#4

🤖 Generated with Claude Code

Host-side test suite that builds the hardware-independent logic as a
native Linux ELF and exercises it, with no dependency on the format/lint
PR: it drives the test Makefile directly and ships its own workflows.

- ASan/UBSan + Valgrind harnesses (secret/QR, base64) run as a hard gate
- base32 UB fix: encode buffer int -> uint32_t (shift past int width)
- own .github/workflows/test.yml (make -C test asan|valgrind|coverage)
- pages.yml publishes the lcov/genhtml coverage report to GitHub Pages,
  built via `make -C test coverage` instead of the format PR's ci script
- .gitignore covers test artifacts (build/, coverage/, *.gcno, *.gcda)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@d33mobile

Copy link
Copy Markdown
Author

Recreated from scratch with fresh commits as #5 (suspected GitHub downtime left this one in a bad state).

@d33mobile d33mobile closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant