knurling-rs / probe-run

Run embedded programs just like native ones
Apache License 2.0
643 stars 75 forks source link

add first, user-triggered snapshot tests #218

Closed Lotterleben closed 3 years ago

Lotterleben commented 3 years ago

to try them out locally, connect an nrf52840 and run cargo test -- --ignored

these test cases are pretty basic to give us some sort of baseline and can be expanded in subsequent PRs. In the future it'd be cool to have them set up as hardware in the loop tests but I think they're already helpful during development as-is, even if we don't catch regressions automatically (yet)

Urhengulas commented 3 years ago

I am wondering if these tests will break with a next compiler release, because this might impact the program size, which is encoded e.g. here https://github.com/knurling-rs/probe-run/blob/7e4e05172959e7d0d307e62c4ada38f5ff05bf36/tests/snapshots/test__panic_is_reported_as_such.snap#L6

But it seems that it at least shows the same for the current nightly, so I guess this is a not-problem 😬

Lotterleben commented 3 years ago

I am wondering if these tests will break with a next compiler release, because this might impact the program size, which is encoded e.g. here

https://github.com/knurling-rs/probe-run/blob/7e4e05172959e7d0d307e62c4ada38f5ff05bf36/tests/snapshots/test__panic_is_reported_as_such.snap#L6

But it seems that it at least shows the same for the current nightly, so I guess this is a not-problem 😬

Since we're not re-compiling but running precompiled binaries that should be ok. If we ever recompile them then yes, we'll have to update the tests :D But I think that's actually a useful canary

japaric commented 3 years ago

@Lotterleben feel free to send this to bors after a rebase

Lotterleben commented 3 years ago

bors r+

bors[bot] commented 3 years ago

Build succeeded: