I mentioned this on IRC recently but I think now that we have most of the basics supported it'd be good to start adding some gdb integration tests. My thought would be that we'd have something like struct TestHandler that has an impl Handler, but with ways to mock out its output. (There don't seem to be any trait-mocking crates that work with stable Rust without requiring a build script currently, so we may just have to hand-roll something.) Tests would instantiate a TestHandler, add some expectations to it, then run a server for it on a background thread. We would then run like gdb -nx -batch -ex 'target remote localhost:port' [-ex cmd] -ex quit where the test would pass a list of additional commands, and match against gdb's output. I recently wrote some tests for sccache using assert-cli which was pretty nice for writing this sort of test.
Until we get useful support for qXfer for files and whatnot we might need to have a prebuilt binary checked in and point gdb at it with file or whatever to make things work.
I mentioned this on IRC recently but I think now that we have most of the basics supported it'd be good to start adding some gdb integration tests. My thought would be that we'd have something like
struct TestHandler
that has animpl Handler
, but with ways to mock out its output. (There don't seem to be any trait-mocking crates that work with stable Rust without requiring a build script currently, so we may just have to hand-roll something.) Tests would instantiate aTestHandler
, add some expectations to it, then run a server for it on a background thread. We would then run likegdb -nx -batch -ex 'target remote localhost:port' [-ex cmd] -ex quit
where the test would pass a list of additional commands, and match against gdb's output. I recently wrote some tests for sccache using assert-cli which was pretty nice for writing this sort of test.Until we get useful support for
qXfer
for files and whatnot we might need to have a prebuilt binary checked in and point gdb at it withfile
or whatever to make things work.