rust3ds / ctru-rs

Rust wrapper for libctru
https://rust3ds.github.io/ctru-rs/
Other
117 stars 17 forks source link

Improve Testing and CI #106

Open Meziu opened 1 year ago

Meziu commented 1 year ago

We should mass produce tests now that the API is getting stabilized, and integrate with the CI to make sure the examples build after changes.

ian-h-chamberlain commented 1 year ago

Definitely agree, unfortunately after doing a bit of research, I found out some things:

For now, we should probably keep all the examples as ```no_run, and try adding something to CI to make sure they at least compile. I might open a separate issue for the runner itself, since I think that will be a bit more involved and might even require changes to upstream citra to be effective.

ian-h-chamberlain commented 1 year ago

With lots of doctests in #134 I've marked this "In Progress", at least. I haven't had a chance to revisit the citra runner to really test everything though, so I'd say let's leave it open for now.

Meziu commented 1 year ago

I've noticed the CI still needs a little boost, and unit tests are very much lacking, so this issue needs to stay open for a while longer.

ian-h-chamberlain commented 1 year ago

I've made some progress on a proof of concept for running tests using Citra: https://github.com/ian-h-chamberlain/test-runner-3ds

So far I can get it to work with integration + unit tests, but it's not running doctests yet.

Example of passing: https://github.com/ian-h-chamberlain/test-runner-3ds/actions/runs/5781441190/job/15666535932 and failing: https://github.com/ian-h-chamberlain/test-runner-3ds/actions/runs/5781347357/job/15666313158

For now, I just copied all the test runner code out of ctru-rs — if this seems like a good direction to continue in, I can migrate the test-runner-3ds repo to rust3ds/test-runner (open to better names too) and start the process of using it in ctru-rs.

I wanted to have this as a separate repo so we can reuse it for e.g. citro3d-rs and make it usable for others if they want. I don't think we strictly need to publish the crate either, since cargo allows for git dev-dependencies when publishing.

adryzz commented 6 months ago

I have recently made an app (in rust of course) to run unit tests back-to-back on physical consoles. it uses a reimplementation of 3dslink and the rosalina 3dsx loader, and almost works perfectly, just needs a few fixes for launch parameters.

It also supports toggling Luma3DS's GDB stub on a very hacked together branch.

This works when compiling the app as a .cia file to install, and a few additions to pass back the result to the app, to then log (both to a file and the bottom screen).

This is the end result, although this branch is very cursed and i'm adding things bit by bit as i clean them up

image