I am writing an autograder in Rust. I would like to use Rust's inbuilt testing capabilities and integrate them with autograding infrastructure provided by Gradescope. Gradescope requires a JSON file with various annotations about the students' scores (for details: https://gradescope-autograders.readthedocs.io/en/latest/specs/). I was hoping to generate this JSON file based on the results of
cargo test, but this would require the ability to access those results programmaticaly. One solution is to scrape the result of
cargo test from stdout, but I was hoping that there was a better way that didn't involve parsing strings.
I assume that Cargo builds some kind of programmatic representation of the test results before printing them to the terminal. Is it possible for me to access this programmatic representation somehow?