Skip to content

Host test suite + coverage report (independent)#5

Merged
Tomunek merged 2 commits into
hakierspejs:masterfrom
d33mobile:chore/host-tests-suite
Jul 8, 2026
Merged

Host test suite + coverage report (independent)#5
Tomunek merged 2 commits into
hakierspejs:masterfrom
d33mobile:chore/host-tests-suite

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#7

Recreated from scratch with fresh commits (the previous #4 looked corrupted after a GitHub downtime).

🤖 Generated with Claude Code

…es, base32 UB fix, own test.yml + pages workflow, lcov/genhtml report

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A fresh clone has empty libs/qrcodegen and libs/littlefs, so `make -C test`
failed with a cryptic gcc "qrcodegen.h: No such file" error. Add a
check-submodules prerequisite to asan/valgrind/coverage that fails fast
telling the user to run `git submodule update --init --recursive`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Tomunek Tomunek merged commit 61a8198 into hakierspejs:master Jul 8, 2026
2 checks passed
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.

2 participants