mitsuhiko / insta

A snapshot testing library for rust
https://insta.rs
Apache License 2.0
2.15k stars 98 forks source link

binary & bitmap unit testing (for embedded) #604

Open ponyatov opened 6 days ago

ponyatov commented 6 days ago

Is this crate suitable to test

For 2D vector graphics render tests if would be great to have snaps in lossless & no-compression image formats to view it as is in VSCode or any other tool. (not shure is it possible for RGBA and narrow paletted colors).

max-sixty commented 6 days ago

There's some ongoing work to add binary snapshots: https://github.com/mitsuhiko/insta/issues/604

What are the requirements for this working on embedded systems? I've generally thought of embedded systems as not having access to std, and so no access to a file system — how would that work for binary snapshot tests?

ponyatov commented 6 days ago

I've generally thought of embedded systems as not having access to std, and so no access to a file system

algorithmic parts can be isolated and tested on host with conditional compilation

Also gdb API allows to do some tests on a real hardware, but it looks too complex for implement.

max-sixty commented 6 days ago

OK, would it be possible to sketch out what that might look like, more specifically? Would we get the snapshot values with an include_bytes! call? How would that know where to look?