Skip to content

Add some CI testing#27

Open
matte1 wants to merge 6 commits into
samitbasu:mainfrom
matte1:matte1/ci
Open

Add some CI testing#27
matte1 wants to merge 6 commits into
samitbasu:mainfrom
matte1:matte1/ci

Conversation

@matte1

@matte1 matte1 commented May 15, 2026

Copy link
Copy Markdown

Generally just fixing up some tests that had hard coded paths and getting some test/ci infra in place.

matte1 added 6 commits May 15, 2026 08:18
The miette diagnostics rendered into expect-test snapshots embed the
absolute file path of each source span (canonicalized at proc-macro time).
That made every snapshot fail on any machine whose workspace lived under a
different prefix than the original author's.

Strip the workspace-root prefix from rendered diagnostics before
snapshot comparison, and re-record all affected snapshots with paths
relative to the workspace root.
CI runs fmt-check, clippy (lenient), and the full workspace test suite
on every push and PR to main, with the IceStorm FPGA toolchain
(yosys, nextpnr-ice40, fpga-icestorm) installed via apt so the timing
tests can run.

The Justfile mirrors the same steps so they can be reproduced locally
with `just ci`.
Mechanical pass to satisfy `cargo fmt --check` so CI's fmt step is
green. No semantic changes.
Many tests cross-check Rust simulation against Verilog by shelling out
to iverilog/vvp. Without it ~8 tests in `rhdl --test binding` (and
similar) fail with "No such file or directory". The iverilog package
provides both binaries.
- rhdl-vlog: import `syn::parse_quote` (was using `quote::quote`,
  which doesn't expose `parse_quote!`).
- rhdl-core sim::iter::uniform: doctests referenced
  `rhdl_core::sim::uniform`; the module now lives at
  `sim::iter::uniform`.
- rhdl-core circuit::fixture: the example used `#[kernel]` and
  `bind!`, both of which live above rhdl-core in the dep graph
  (rhdl-macro and rhdl). Mark this copy as `ignore` and point at
  the runnable version on `rhdl::prelude::bind`.
- rhdl prelude: re-export `AsyncFunc` so the `bind!` doctest can
  call `AsyncFunc::new`. Replace the stale `fixture.io()` (now
  `io_dont_care()`) and wrap the body in a hidden Result-returning
  main so `?` works.
nextest runs test binaries in parallel; for this workspace it cuts
end-to-end test time roughly in half. Doctests are still run via
`cargo test --doc` since nextest doesn't handle them.

Both CI and the local Justfile pick up the change via `just test`
(nextest) and `just doctest`.
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